Jump to content


Photo

hello


  • Please log in to reply
27 replies to this topic

#1 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 12 March 2004 - 09:49 AM

hello guys. i'm a computer engineer student from Turkey and have just joined you. i can obviously say that i am a master of programming. if u wanna ask something about c or c++ or even java will be here always to share my knowledge. since i am a new member as far as i read ur writings u r mostly students or beginners of programming. am i right? i can also answer ur questions about linux, logic design or wireless technologies which i am interested in too much. i wanna be an active member here. so waiting ur welcomes. have a nice day.

#2 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 12 March 2004 - 11:46 AM

Welcome :)

Most people here are students, around 16-22.

I've noticed a gap between learning basic to intermediate C++. Once you learn about if's and while's your stuck with a gap to put them into practice. If you know of any basic to intermediate tutorials around it would help.

#3 Mad Ivan

Mad Ivan
  • Project Team
  • 115 posts
  • Location:Bug City
  • Projects:Allies Revenge 3

Posted 12 March 2004 - 09:23 PM

hello guys. i'm a computer engineer student from Turkey  and have just joined you. i can obviously say that i am a master of programming. if u wanna ask something about c or c++ or even java  will be here always to share my knowledge. since i am a new member as far as i read ur writings  u r mostly  students or beginners of programming. am i right? i can also answer ur questions about linux, logic design or wireless technologies which i am interested in too much. i wanna be an active member here. so waiting ur welcomes. have a nice day.

hello.
I guess we are neighbours - I am from Bulgaria, Sofia :)

I am a starter at C++ and i would also like to ask if you can help arround with tutorials and stuff :)
Posted Image

#4 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 12 March 2004 - 10:42 PM

of course i can help you about everything in c++. but tell me a topic. tutorials about which part of c++? i can send you source code examples also. if u tell me a main topic. i can write everything about it with pleasure guys.waiting for ur questions. salutations to sofia and detail's country. thnx for concerning. have a good day...

#5 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 12 March 2004 - 11:44 PM

Info about either of these would help me:

- How to make Windows forms and menus without visual C++ would be very useful to know about.

- Some way to mass convert '.aud' (audio) files into '.wav' (wave) files. Allowing for diffrent rate, bit and mono/stereo.

#6 Guest_Guest_Hellfire_*

Guest_Guest_Hellfire_*
  • Guests

Posted 13 March 2004 - 02:29 AM

Yes like detail said above programing a windows application tutorial would be very nice.

#7 the_kid

the_kid

    L337 Pwnerer of N00bs

  • Project Team
  • 1,734 posts
  • Location:La$ Vega$, NV
  • Projects:freelancing between what interests me
  •  + TRIPLEhelix

Posted 13 March 2004 - 07:11 AM

yeah, and I would like to know stuff like how to make a program:

-check for specific file
-create/delete files
-write to some kind of log file

that is the kind of stuff I've been interested in, well for the moment anyway, cuz I don't have any real needs to make a program. But this is stuff I often wonder about.

#8 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 13 March 2004 - 08:53 AM

//Remove a file
#include<iostream.h>
#include<fstream.h>
#include<stdio.h> //for remove( ) and rename( )
#include "apstring.cpp"

int main(void)
{

apstring fileToDelete;

cout<<"Enter name of file to delete: ";
getline(cin,fileToDelete);
if (remove(fileToDelete.c_str( )) !=0)
cout<<"Remove operation failed"<<endl;
else
cout<<fileToDelete<<" has been removed."<<endl;

return 0;
}

#9 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 13 March 2004 - 09:06 AM

The first step is to declare a connection to the file logger server and create the log file:

// Open a connection to the File logger server
RFileLogger iLog;
iLog.Connect();
iLog.CreateLog(_L("MyLoggingDirectory"),_L("MyLogFile"),EFileLoggingModeOverwrite);

...

// Close the log file and the connection to the server.
iLog.CloseLog();
iLog.Close();

The CreateLog function takes three parameter:
the base name of the log directory (relative to C:\Logs and without trailing '/')
the name of the log file
the logging mode (EFileLoggingModeOverwrite or EFileLoggingModeAppend)

In the exemple code above, the full path to my log file (on the phone file system) would be C:/Logs/MyLoggingDirectory/MyLogFile.

As far as I am concerned, I like to put the opening code in the ConstructL() method of the class I want to trace, and the closing code in the destructor. Also note that in real production code, you would better check that Connect() and CreateLog() does return KErrNone.

Once you have done this, you can output text and data to the log file. The basic primitives are:

Primitive Output in the log file
iLog.Write(_L("Hello World")) 11/07/2003 4:00:13 Hello World
iLog.WriteFormat(_L("Result=%d"),err) 11/07/2003 4:00:13 Result=0
iLog.HexDump(aHeader,aHeader,myPtr,4) 11/07/2003 4:00:13 myBuf:0000: 41 42 00 44 AB.D

If you don't want to have date or time logged, you can turn it off by using iLog.SetDateAndTime(TBool aUseDate, TBool aUseTime).

Don't forget to add the flogger.lib in your MMP file and to include the flogger.h file, and that's it. You can compile, execute and get your log file.

#10 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 13 March 2004 - 09:10 AM

sorry i forgot to say nothing will be logged unless you manually create the C:/Logs/MyLoggingDirectory by yourself.

#11 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 13 March 2004 - 09:20 AM

detail, which programs do u want to use but visual c++?
and converting program should allow you to create a new file , change its extension and zip it up to 10 times. if u compound these function methods , something can be formed.

#12 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 13 March 2004 - 01:19 PM

I'd like to know how to make menus with Dev-C++.

converting program should allow you to create a new file , change its extension and zip it up to 10 times. if u compound these function methods , something can be formed.

Far beyond my current skill.

#13 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 13 March 2004 - 03:09 PM

Accelerator keys allow a user to access menu items quicker by pressing a pre-defined combination of keys, instead of having to click on a specific menu item everytime it is requred. An accelerator table, which contains a list accelerator keys, has the following structure:

[TableName] ACCELERATORS

{

KeyCode, Message Id [, Type, Options]

KeyCode, Message Id [, Type, Options]

KeyCode, Message Id [, Type, Options]

}

KeyCode: The KeyCode value should contain the key combination that will trigger the accelerator. The key code can be either:

* Any alphanumeric character enclosed in quotes, such as “a”, “C”, “6”. These are case sensitive.
* The header file afxres.h defines several macros for “virtual keys”. Virtual key macros allow keys such as F1 and F2 (VK_F1 to VK_F12) to be used as accelerator keys. If a virtual key is used as the key code, then the type should be set to VIRTKEY.
* The ASCII code number of a character. If an ASCII key code is used, then the type should be set to ASCII.

Message Id: The message Id should contain an ID declared as part of an ON_COMMAND() macro for a windows message map. For example, your application would use IDM_1, IDM_2 and IDM_3.

Type: Can be either empty, VIRTKEY or ASCII, as described above.

Options: If CONTROL is specified, then the control key must be pressed to trigger this accelerator key. If SHIFT is specified, then the shift key must be pressed to trigger this accelerator key. If ALT is specified, then the alt key must be pressed to trigger this accelerator key.

Adding an accelerator key for a menu item is easy. To make the CMainWin::OnItem1() function execute when you press the Control key and the 1 (one) key, you would add the following code to the end of your resource file, menu.rc:

MyKeys ACCELERATORS

{

"1", IDM_1, CONTROL, VIRTKEY

}

To trigger the CMainWin::OnItem2() function when we prress the F2 key, you would add this accelerator key:

VK_F2, IDM_2, VIRTKEY

To trigger our the CMainWin::OnItem3() function when you press the “3” key, we would add this accelerator key:

51, IDM_3, ASCII // 51 is the ascii code for the 3 key

you can’t actually use these accelerator keys yet. you need to load the accelerator table. Double click on menu.cpp and add the following line just before the end of the CMainWin constructor:

if(!LoadAccelTable("MyKeys"))

MessageBox("Couldn't load the accelerator table");

The LoadAccelTable function is a member of the CFrameWnd class, accepts one parameter, the name of the menu (in quotes), and returns a BOOL value. It loads our accelerator table into memory and sends the notification messages to our application when the right combination of keys is pressed.

To make sure your accelerator keys work, compile and run our app. First, press Cntl+1. Next, press the F2 key. Lastly, press just the “3” key. Each different OnItem function should be triggered.

To make your menu items display the accelerator keys they respond to, change the MENU table in menu.rc, like this:

MyMenu MENU

{

POPUP "Popup"

{

MENUITEM "Item One\tCntl+1", IDM_1

MENUITEM "Item Two\tF2", IDM_2

MENUITEM SEPARATOR

MENUITEM "Item Three\t3", IDM_3

}

}
i attached the output of this applet . dont know that would help you

Attached Images

  • mfc2_5.gif


#14 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 13 March 2004 - 07:43 PM

Thanks burakcayir, i'll give this a try later.

#15 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 13 March 2004 - 09:48 PM

not at all detail. stino why should i write em in quote boxes? arent they clear so?

#16 Stino

Stino

    AKA Stink_o

  • Hosted
  • 1,421 posts
  • Location:the Netherlands
  • Projects:Blitzkrieg II:The Finest Hour (BlitzII:TFH)
  •  Doer of Things

Posted 13 March 2004 - 10:22 PM

I think it's more clear like that.
Posted Image

#17 Mastermind

Mastermind

    Server Technician

  • Undead
  • 7,014 posts
  • Location:Cambridge, MA
  • Projects:MasterNews 3
  •  The Man Behind the Curtain

Posted 14 March 2004 - 12:09 AM

Yeah, or use the code box. It separates any text you might post as explanation, and the actual code. It's usually just easier to read and understand.
:)
Posted Image

Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.

Too cute! | Server Status: If you can read this, it's up |

#18 burakcayir

burakcayir
  • New Members
  • 10 posts

Posted 14 March 2004 - 09:56 AM

ok guys ill try so later. dont worry. meanwhile u have another questions?

#19 the_kid

the_kid

    L337 Pwnerer of N00bs

  • Project Team
  • 1,734 posts
  • Location:La$ Vega$, NV
  • Projects:freelancing between what interests me
  •  + TRIPLEhelix

Posted 14 March 2004 - 09:51 PM

yeah, whats the easiest way to display text in a win32 program.... i assume it uses MSG = &messages then something to do with a switch for &messages.... I've taken a look at some examples but I still have trouble.

#20 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 15 March 2004 - 11:57 PM

Seems very long winded, compaired to VB6.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users