|
I would like to design an application that has a caption bar, menu bar, one or more toolbars, and a status bar. There is no document or data to be displayed in any view directly.
Does anyone know of a sample application like this? It is similar to the way VB looks in what is called its SDi mode I think.
Or any pointers as to how to do this would be helpful. I thought of creating an SDI application and limiting the view frame size but I am not sure if this is the best way, or how to do it!
Thanks
Sid
|
|
|
|
|
Do you mean some application that has different windows not united by main window, like Delphi?
If so, I think you can use function CreateDialog() and create a number of dialogs in different places of the screen.
|
|
|
|
|
hi,
I am trying to programatically update the version information in a dllI am using
Beginupdateresouce
updateresource
Endupdateresource.
The functions always suceed but the resource is not updated. Is there any program or code which is available in the net to do this. any thoughts will be greately appreciated. I am running the program on NT.
thanks
karthik
ps:
I am running the program on NT
I know that if we have the source we can edit version info in VC++,but I dont want to do it that way
|
|
|
|
|
If you may do it manually, try one tool from this address
http://www.blubb.at/sweety/toolz/resource.htm
|
|
|
|
|
Well, I was unable to update resource also. I've just got the same second resource with the ID like I've wanted to update, but it appeares like I had 2 resources instead of 1 updated.
|
|
|
|
|
This happened to me also.
However, I tracked it down to not setting the locale correctly when I saved the resource back to the file.
You can load the resource specifying a generic language identifier... "If this parameter is MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used."
When you go to save it, however, the language ID better match what was in the file in the first place or else you will end up with another resource stuffed into the file with a different language identification associated with it!
The resources in my file are tagged with the following:
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|
|
|
|
I figured it out!
You MUST free the library prior to using the BeginUpdateResource, UpdateResource, EndUpdateResource sequence.
Even though update always truly failed when library was loaded in memory, no errors were indicated or returned!
Here is pseudo-code sequence...
LoadLibraryEx <- no need to execute dll entry point
FindResourceEx
LoadResource
LockResource <- gets pointer to data
SizeofResource <- how much data you got
...allocate memory to hold modifiable copy of resource data
...make copy of resource data into memory block
FreeLibrary <- important to do it here
BeginUpdateResource
...modify resource data, or supply new data if you want
UpdateResource
EndUpdateResource
...deallocate memory you obtained earlier
That's it!
As a test, I was able to modify the fixed file version information (dwFileVersionMS and dwFileVersionLS fields
in the VS_FIXEDFILEINFO) and see that the changes had occurred.
|
|
|
|
|
I want to write windows programs. I don't know where to start. Do you know of any websites/books that you found to be of great help?
|
|
|
|
|
As for C++ books, I can recommend a couple good ones. First, try Inside Visual C++ 5.0. It hasn't been updated since the author passed away, but this is a good starting point. Next, I would suggest Programming Windows 95 with MFC by Petzold. Also, I have been happy with Mike Blazack's Professional MFC as well. All 3 of these books together would give you a great starting point. Another one that would probably help you get up to speed is Sam's Teach Yourself Visual C++ Programming in 21 Days. As far as websites, you can look here as well as CodeGuru (http://www.codeguru.com).
|
|
|
|
|
Uh, if you don't already know C++, please do yourself a favor and stay away from application specific books like "Inside Visual C++ x.x", "Teach Yourself Visual C++ ...". Buy a book that focuses on the language C++. Later, when you know C++ and want to get more familiar with Microsoft's development tools for C++, you can read a "Visual C++" book. Until then don't muddle the two things in your brain: there is C++ the language and there is Visual C++ which is a development tool for C++.
Some recommened C++ books:
Stanley B. Lippman
C++ Primer, Second Edition
Addison Wesley
ISBN 0-201-54848-8.
Bruce Eckel
C++ Inside & Out
McGraw-Hill
ISBN 0-07-881809-5.
(and for the hardcore only.. more of a refernce than a learning guide...)
Bjarne Stroustrup
The C++ programming language
Addison-Wesley
ISBN 0-201-539929-6
|
|
|
|
|
Well, since he said he wanted to learn Windows programming (using C++) then I assumed that he knew C++. Obviously, you should know the language construx before attempting to do development with it. That's why my suggestions focused on using C++ to develop Windows apps, versus scholarly language references like Stroustrup C++ book.
|
|
|
|
|
"Programming Windows 95 with MFC" by Jeff Prosise is recommended highly among programming circles these days. It's published by Microsoft Press, and you can find it at http://www.bn.com/, http://www.amazon.com/, http://www.fatbrain.com/, or in the computer programming section of your favorite bookstore.
Cheers,
Brian
|
|
|
|
|
when i run my program in debug , i got a lot of the follwing message in the debug windows:
First-chance exception in CJFtp.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
the program appears to work ok. Anyone can see a problem here?
thanks
|
|
|
|
|
Your program will probably run ok, but if you're lucky you might be able to eliminate the exception.
While running in debug mode, select the Debug | Exceptions menu. In the Exceptions dialog, scroll to the bottom and select the Microsoft C++ exception entry, and change the action to stop always.
The next time the exception occurs, you will interrupt the program. Since this one comes from the kernel, you probably won't be able to see anything more than an asm dump, but if there is a reasonable call stack available you might be able to track down a likely cause.
Alternatively, you might be able to break and step through the code you can see until you trip it.
These can be mysterioius and hard to find though, especially in GDI or kernel code. But worth a look - very nice to be able to get rid of output window clutter!
|
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
Usually, posting the problem 4 times does not solve it
More seriously, did you try the debug version? Does it have the same problem?
I remember that once I had the same problem, and it only came out in the Release version, but I can't remember what was the cause.
Before your test, try to do a complete rebuild. Sometimes this helps.
Then, you should look at your dialog code first, instead of some address in MFC42.DLL .
Probably you are passing a temporary object to a member function, which stores it somewhere. When the object falls out of scope it is destroyed; so when you close the dialog, some other private member tries to access an object that no longer exists and you have an Access Violation.
Look for the calls in which you pass a pointer, check if that functions set some internal variable with that pointer. If so, the pointed object should live as long as the dialog and you should make it a member of your derived dialog class.
Good luck,
Paolo
|
|
|
|
|
hmm didn't think I posted 4 times... sorry.
At first it occured only in the release version, so I played with the debug settings a little until it basically mimicked the release, but I could run it through the debugger. I don't call any functions, except for DoModal. I call a couple from within (sometimes this dialog also functions as a splash screen, so I have to close it automatically after x seconds). Stepping through, the most I can narrow done where the error occured was to sometime between the call to EndDialog() and the point where DoModal returns. I don't have any pointers... the only thing odd I have done is to apply a bitmap background to the dialog and i have got a class to make static text into hyperlinks. I have looked at the code for both and don't think that they are causing the problem, but I'll go take another look at them.
|
|
|
|
|
If the debug version is OK, maybe you are using some uninitialized variable. Try compiling at warning level 4 and ignore all the warnings coming from windows include files.
If you try to call EndDialog at the end of your OnInitDialog, what happens?
|
|
|
|
|
>If the debug version is OK, maybe you are using some
>uninitialized variable. Try compiling at warning level 4
>and ignore all the warnings coming from windows include
>files.
Did that, had a couple warnings about variables being initialized but never referenced, and a couple about formal paramters never being referenced (things like pDC in OnDraw for my view, which I never use)
>If you try to call EndDialog at the end of your >OnInitDialog, what happens?
Same errors
sigh... I may just put together a small project that uses this and send it to you so you can look at it... that ok?
Thanks,
Adam
pandcc3@comwerx.net
|
|
|
|
|
I would be happy to help you, but not this days.
If you wish, you may send me your little project next week, after the 7th of June. I will be too busy 'til then.
If you may wait...
Cheers,
Paolo
|
|
|
|
|
This problem often occurs if you are trying to delete or access object that does not exist.
In the debugger you will be able to see call stack, which can let you identify which line in your code is causing this problem.
|
|
|
|
|
I wish it were that simple... I never access the dialog box... all I call is the constructor when i first make it, and then DoModal(). thats it... and the call stack was useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|