|
you are calculating it like this "(j-i)", which is actually subtracting one address from the other, giving a new address. You then print the value of that address, which would be 0x00000004.
|
|
|
|
|
Hi guys.
I encounterd a problem, I want to read and wirte to the file using CArchive class,
how can i read and write at the same time using CArchive. On the other hand, I want to wirte in the file at specific position using CArchive.
Please help me out.
Thanks,truely yours.
Affectionately.
|
|
|
|
|
Hello good boy,
it is as easy as you can imagine.
You must define one CFile object and two CArchive objects, the first one for reading and the second for writing; So, you map both CArchive objects to the CFile object.
Wow.
It is for you Mohammad !
|
|
|
|
|
Hello,
I am a newbie.
I have read source code of many programs.
They contain some application forms.
I can't know which function is created for user interface or change file time.
I would like to see the easy code to change file time.(Any language C/C++ , Java , Or VB)
I would like to change file attribute
- created time
- last modified time
- last access time
Any one can help me?
Thank you.
|
|
|
|
|
toeh wrote: I would like to change file attribute
- created time
- last modified time
- last access time
What's wrong with SetFileTime() ??
|
|
|
|
|
I'm trying to set tabs in a list box. The box works - my fields are being displayed in the box, but the tab setting apears to have no effect. I have tried settings from 1 to 200 and nothing happens. Ideas? Thanks.
ComplMessage.Format("%d %s %s %.4f %.4f %.4f %d",
Subs[i].ComboLine,
Subs[i].ContractName,
Subs[i].ContractDate,
Subs[i].Last,
Subs[i].Bid,
Subs[i].Offer,
Subs[i].Volume);
int tabber = 10;
int tabs[7];
tabs[0] = tabber;
tabs[1] = tabber;
tabs[2] = tabber;
tabs[3] = tabber;
tabs[4] = tabber;
tabs[5] = tabber;
tabs[6] = tabber;
pListBox->SetTabStops(7, tabs); <-- this doesn't work
pListBox->AddString(ComplMessage); <--this works
|
|
|
|
|
You are setting all 7 stops at the same location?
What about...
int tabber = 10;
int tabs[7];
for (int i = 0; i < 7; ++i)
tabs[i] = i * tabber;
pListBox->SetTabStops(7, tabs);
*EDIT* Tab stops are in dialog units BTW :)
|
|
|
|
|
I need to revise an existing Installer program, One that someone might have, that will allow me to automatically install programs on a CD to C:\ .
Does anyone have the source code for such an "installer"?
Also, I need the source code and explanation for how to make a program "run" automatically when the CD is put into the CD drive.
Any help on either of these topics would be greatly appreciated.
Thanks,
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: Does anyone have the source code for such an "installer"?
Not quite sure what you mean here. An installer is simply an exe that will either copy compressed files or raw files to a specific location, then create shortcuts and registry entries. There is no special installer to be used with CD's, but usually the files on a CD will be in raw format.
Larry Mills Sr wrote: Also, I need the source code and explanation for how to make a program "run" automatically when the CD is put into the CD drive.
Again, there is no magic software to do this. You cannot force a program to be run from a CD because the user is able to enable/disable this option. To create an autorun CD all you need is to create a file called autorun.ini in which is the path to the exe to run and an optional icon. If the user has enabled the autorun feature, windows will look for this file then run the exe.
|
|
|
|
|
I'm not sure how to copy files and directories in MFC. I have done it in API, but not in MFC.
Could you show me a simple code that would 10 Create the Directory and then copy the files to the directory in MFC.
Also, I know nothing about ".ini" files and where they are placed in, ie, another file?, and how they are used. Could you give me a simple example that I could base my program on CD for?
Thanks
A C++ programming language novice, but striving to learn
|
|
|
|
|
I don't code in MFC so I wouldn't know how. But MFC is just a wrapper to the API, so it is perfectly safe for you to use the API functions you already know.
The ini file is stored in the directory. The best way to learn is to get any CD that autorun's ( nearly all games ). And click 'Explore' in the windows explorer. If you don't see the file you may have to select 'view system files and folders' from the explorer options.
Open the file in a text editor.
-- modified at 23:10 Saturday 11th November, 2006
Sorry, I just noticed I gave you the wrong file extension. It should be *.inf not *.ini.
|
|
|
|
|
hello,
i need to get window handle on which mouse was clicked. how can i do that?
could somebody post an example here?
thank you in advance
|
|
|
|
|
Assuming you want the HWND no matter what application the window belongs to -
You could use a global WH_MOUSE hook: About Hooks[^]
|
|
|
|
|
|
You can also try using the WindowFromPoint() and ChildWindowFromPoint() using the POINT structure that the lParam of mouse messages is pointing to.
|
|
|
|
|
thank you all for replies
i think i almost managed to do this by courtesy of your answers...
|
|
|
|
|
Hi,
I want to include a library (dll) in my project. I use Visual C++ 6.0 and the project type is console.
Could someone hook me up with a simple tutorial how I can include a DLL in my console project and if I start my program it should get extracted to the same folder, also I was looking before on the codeproject articles but did not hit any found.
regards,
Steven. W. McGarten
|
|
|
|
|
532523 wrote: also I was looking before on the codeproject articles but did not hit any found.
I suggest you look again, there are tons of articles on CP dealing with dll's.
If you have the *.h header and *.lib files for the dll, then just add them to your project and you can call any of the dll's functions. If not then you will need to call LoadLibrary() to load the dll, then GetProcAddress() to get a pointer to the functions you need. Search again on CP for those functions, you will find many articles.
|
|
|
|
|
So, where you see the tons of articles who explain how to bind the dll into my executable and extract the library on start as byte array to the same folder?
|
|
|
|
|
|
I need to know how to detect when a user attempts to logoff or shutdown the computer, so that my program can perform cleanup, save, or backups before the session ends. Running Visual Studio 6.0 not .NET.
Thanks,
Mark
|
|
|
|
|
Check out the WM_QUERYENDSESSION and WM_ENDSESSION messages
|
|
|
|
|
Hello everyone,
I have a two dimensional array. Currently, I am using the following method to sort,
1. Sort by the first dimension,
2. If the first dimension is equal, then sort by the second dimension.
For example, here is the result of the array I could get,
<result 1="">
[1, 2]
[1, 3]
[1, 6]
[2, 4]
[2, 5]
[2, 7]
I want to change it to,
1. Sort by the second dimension,
2. If the second dimension is equal, then sort by the first dimension.
Here is the result I want to get,
<result 2="">
[1, 2]
[1, 3]
[2, 4]
[2, 5]
[1, 6]
[2, 7]
I am wondering what is the most efficient way to get the new sorting result (result 2) by the sorting result (result 1) in old method?
thanks in advance,
George
|
|
|
|
|
George_George wrote: I am wondering what is the most efficient way to get the new sorting result...
Change your algorithm to look at dimensions in the opposite order.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
But in this way, you do not utilize the given information that the input data is already sorted by 1st column -- 2nd column way. I think if we could utilize the information, we could have better ways. Any ideas?
regards,
George
|
|
|
|