|
|
thanks, this will help a lot.
I am now trying to deploy the release exe of my application and test it on the client machine.
If it also fails, then i ll try to link the application statically wih MFC Dlls.
Hope this works !!!
|
|
|
|
|
I have now build a release version of my app and it is working. Can you tell me why it was not working with debug version, while i was including the proper merge modules?? Why it was not working in the presense of the required dlls??
Note: I included the merge module for mfc42d.dll in Wise installer but when I execute this installer on the client machine (having only Windows 2000 Professional) installer does not installs these debug dlls. What is the reason behind this?????????
Thanks
|
|
|
|
|
the windows operating system does not include debug versions of dll software, because they are not needed for non-developer windows users.
|
|
|
|
|
I'm not sure if I summarized what I want to do properly.
Visualize a small dialog box infront of you with 2 buttons (Button1, Button2).
I want to be able to have them both call the same function but within the function distinguish which one was pressed.
example:
OnButtonPressed()
{
if (button1) -blah;
if (button2) -blah;
return
}
I have one more tiny quick question... whats the SDK function that opens the "Browse for Folder" dialog box. i made a quick image of it, it can be seen here http://www.lead2gold.org/BrowseFFolder.jpg
lead2gold
|
|
|
|
|
1- I don't think you can distinguish the 2 buttons since the callback is anonymous, can't you have 2 callbacks that simply call a third function ?
You might do something with some other messages than ON_BN_CLICKED, but I don't know how to do it without looking into it right now.
2- the function is ShBrowseForFolder
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Thank you! I'll try this... thanks for everyone who replied, the other answers were great too, until one said it might be a maintnance nightmare.
p.s. i didn't expect to get the answer so fast!
lead2gold
|
|
|
|
|
You can use GetFocus() to test the pressed button if your buttons are members of your Dialog like this;
OnButtonPressed()
{
CWnd* pWnd = GetFocus()
if (pWnd == m_Button1)
-blah;
else if (pWnd == m_Button2)
-blah;
return;
}
But I think it's better to let every button have its own OnButton pressed function.
SHBrowseForFolder will show the folder dialog.
Arjan.
|
|
|
|
|
Oops this won't work!
Arjan.
|
|
|
|
|
Oké here it is!
Look for ON_CONTROL_RANGE in the MSDN.
ON_CONTROL_RANGE( BN_CLICKED, ID_BUTTON1, ID_BUTTONn, OnButtonPressed )
Arjan.
|
|
|
|
|
but you still don't know which button called the callback .
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
You do!
Your OnButtonPressed function will now look like this;
void OnbuttonPressed(UINT nID)
{
}
Arjan.
|
|
|
|
|
darn !! I stand corrected ...
Thanks.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Imho, the ON_CONTROL_RANGE can result in a maintenance nightmare. As your software evolves, it's possible that ID_BUTTON1 and ID_BUTTONn may not be consecutive, which can cause hard-to-find bugs.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
That is right, that why I don't use it myself after it happened one time.
Arjan.
|
|
|
|
|
Hi, all
I am trying to write a little experiment program where it is supposed to copy a function (the bytecode) during runtime. But I have encountered a problem, which seems to be VC++ fault (at least in debug mode). Whenever you want a function reference, VC++ gives you a different memory location than the where actual function is located. VC++ gives you a location of a jump instruction, which jumps to the actual function. But because I want the exact functions location in memory I am experiencing a problem. I hope you understood my problem (if not please reply, so I can clarify my self). Any ideas on how to avoid the problem with getting the wrong location?
Thanks in Advance
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
Is the function you are copying inside a DLL?
John
|
|
|
|
|
nop, a regular exe
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
I brought this up because I know dlls use a lot of JMP instructions into the actual code. The thing is that this is perfectly legal but not what you would expect. You may have to play with the compiler settings to turn off that feature.
John
|
|
|
|
|
Not sure if this will disable it in Debug mode, but you can try turning off the "Link incrementally" option on the Linker tab of the project settings. However, it may be that in debug mode it always uses the jmp instruction, regardless of the setting, so it can link faster.
Chris Richardson Terrain Software
|
|
|
|
|
Thanks man! That did the trick
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
I am updating old code and came across a marco that is causing a few thousand warnings in my debugging. I was hoping that one of you could help me understand how to get rid of these warnings.
The Macro is:
#define CNULL(a, b) ((V_VT(&(a)) == VT_NULL) ? b : a)
The code to call it is:
CString name = CNULL(f->Item[_T("StationName")]->Value, btEmpty).bstrVal;
where
f->Item[_T("StationName")]->Value is a BSTR wrapped as a _variant_t
btEmpty is a blank BSTR
I get "warning C4238: nonstandard extension used : class rvalue used as lvalue"
However, I get no warning when I do:
_variant_t tmp = f->Item[_T("StationName")]->Value;
CString name = CNULL(tmp, btEmpty).bstrVal;
Does Anybody know how I can form my macro to not get this warning?
Thanks
Rob Pellegrini
|
|
|
|
|
Hi,
I'm attempting to write an improved file packer for a game package. (The one I already created extracts the game files from an archive to the hard-drive before running the game, which is obviously very insecure.) Essentially, what I want to do is use a compressed .zip file as though it were a regular Windows directory - in other words, to run the game from inside the .zip file without unpacking it - is this possible?
Eg. I would compress all the game files into a zip file. Then I would like to write the code for an executable that could run the game from inside the zip file without needing to extract all of the files to a temporary directory on the hard-drive first. (By password-protecting the zip file it would have some very low-level protection, which is all I really need.)
I have seen something about "mounting" zip files, "virtual file systems" and transparently opening files elsewhere, but I'm not sure if this is what I need or where to start (obviously I don't want my users to be able to see the files inside the zip unless they open it with a zip program) - I am a novice when it comes to programming, and my only experience is with the WinAPI, which is what I would prefer to stick with.
If anyone can point me in the right direction - or even better, towards a library that will suit my needs - I would be eternally grateful.
Many thanks,
KB
|
|
|
|
|
From what I have heard password protected zip files are easily cracked if you have the right software and a fast cpu...
John
|
|
|
|
|
I'm not too concerned about this - the average user won't be able to crack it, and pretty much any file packer with low-level protection can be cracked. I'm more interested in archiving the files to take up less space on the disk and running them without the need to extract them; that the average Joe won't be able to mess around with (or mess up) the files is an added bonus.
Does anybody know of a way to do this? (Other file packing suggestions are welcome too, though I quite like the Zip process as it saves me writing a packer.)
Many thanks,
KB
|
|
|
|