|
Well, I think I solved my original problem and so now I don't even need to have a DLL.
What I was trying to do have an .exe use a DLL that just contained a version info resource so I could determine what version of our libraries the .exe was built with. Just using LoadLibrary() on the .exe wouldn't give me any info on the resource, I guess because the DLL does not get loaded; only when it is executed. So I wanted to figure a way to find all the DLL's, search for my version DLL, use LoadLibrary() on it, then get the version resource...whew...
What I have finally figured out is that you can export functions from a .exe! So, I created a header file that the .exe includes (indirectly, by other includes, so it will *always* be included) that exports a function. Then, I can call LoadLibrary() on the .exe, use GetProcAddress() to get a pointer to the exported function, then call it to determine the version, walla! And *much* simpler...
See my following post showing the .h:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=1304933&df=100&msg=1304933#xx1304767xx
Thanks for your comments!
|
|
|
|
|
Hello everyone!
Can anyone PLEASE help me? Look:
http://sulfurmidis.com/mazzee.zip
OK... The code crashes at MazzeeGame.cpp at line 940. It seems that the game pointer in Mazzee.cpp is NULL at the time the Mazzee_MoveMonsters thread (in Mazzee.cpp) calls the Mazzee::MoveMonsters() method... But that can't be true, because, if I put a debug checkpoint at 263 in Mazzee.cpp, the game pointer has all of it's variables set up correctly! Why is this? Does anyone know? Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
I think you'd be better off posting the line and a few lines of surrounding code, than getting someone to download a zip file.
My articles
BlackDice
|
|
|
|
|
Looks to me like the values in objects in the monsters array are not initialised, they all have values like -8432573.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I do initialize them in MazzeeGame.cpp in lines 295-299:
monsters = new Monster[f_monsters];<br />
monsters[f_monsters-1].Location = x-sub;<br />
monsters[f_monsters-1].VerticalLocation = x-sub / width;<br />
monsters[f_monsters-1].SteppingChar.Attributes = c_black;<br />
monsters[f_monsters-1].SteppingChar.Char.AsciiChar = ' ';
HOLD ON A SECOND. I think I realized what the problem is... What does this do:
monsters = new Monster[f_monsters];
Does it clean out the entire array? Or does it just resize it?
I just tried this: realloc(monsters, f_monsters); instead, but I still get the error... How do I resize an array correctly? (Those two haven't worked yet...) Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
realloc is C, don't use it.
Kixdemp wrote: monsters = new Monster[f_monsters];
If there was an array there already, it leaks memory. It creates a new block of memory, with new objects, none of them initialised.
Kixdemp wrote: How do I resize an array correctly?
I'd suggest you look into std::vector if you want a dynamically sizing array.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Using a vector will not initialise the values in it, it simply gives you a dynamically sizing array. You still need to set the initial values for the variables in the struct you're storing in the vector.
How does the vector get set up ? Can you post some code ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Here's the declaration:
std::vector<Monster> monsters;
And here's how I initialize it:
monsters.resize(f_monsters);<br />
monsters[f_monsters-1].Location = x-sub;<br />
monsters[f_monsters-1].VerticalLocation = x-sub / width;<br />
monsters[f_monsters-1].SteppingChar.Attributes = c_black;<br />
monsters[f_monsters-1].SteppingChar.Char.AsciiChar = ' ';
Am I doing something wrong? Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Kixdemp wrote: monsters.resize(f_monsters);
How is this initialising anything ? You shouldn't have to call resize. Where do you call push_back ?
Kixdemp wrote: monsters[f_monsters-1].Location = x-sub;
monsters[f_monsters-1].VerticalLocation = x-sub / width;
monsters[f_monsters-1].SteppingChar.Attributes = c_black;
monsters[f_monsters-1].SteppingChar.Char.AsciiChar = ' ';
This sets up one object, the last in the list. What about the rest of them ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
push_back is how you add things to a vector.
Monster m;
m.strength = 100;
//etc
monsters.push_back(m);
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Oh... alright!
But something still seems uninitialized... even though I initialize everything in the constructor, when I put a checkpoint in PaintMap(), the stuff still has weird numbers... Why is this? Thanks!
PS: Re-uploaded zip file...
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Hi there!
I'm trying to write somthing like this:
template <typename T> class tVar {
public:
virtual operator = ( T );
virtual operator = ( SomethingElse );
private:
T Data;
};
but a problem as arrised here. I'd like SomethingElse to also be a template so I could do:
tVar<SomeType> MyVar;
MyVar<SomeOtherType> = ( SomeOtherType )SomeOtherVar;
Can this be done? If not, i would apreciate some suggestions
Thx!
Peace [[]]
hint_54
|
|
|
|
|
hint_54 wrote: Can this be done?
Of course it can be done. If it could not, then the standard template library (STL) would not work. But it depends on what the template class does and what requirements are placed on the on arguments to the template.
Examples:
vector<vector<int> >; // space between > and > required
vector<string>; // string is defined as basicstring<char>
INTP
Every thing is relative...
|
|
|
|
|
I have a shortcut defined as
%windir%\SYSTEM32\RUNDLL32.EXE "d:\Omega16 xxx\g32csg.dll,FONTMANAGERDIALOG"
rundll32 does not give me any error nor does it execute g32csg.dll. If I change it to
%windir%\SYSTEM32\RUNDLL32.EXE "d:\Omega16\g32csg.dll,FONTMANAGERDIALOG"
with no space in the Omega16 part of the name and also change the actual folder name it works. Any path with spaces doesn't seem to work. This has to be simple but I'm missing it
This is on a W2K system. rundll32 version is 5.0.2134.1
Thanks in advance
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
What about:
%windir%\SYSTEM32\RUNDLL32.EXE "d:\Omega16 xxx\g32csg.dll",FONTMANAGERDIALOG
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
That seems to work as long as the "Start In" field points to the same folder "d:\Omega16 xxx"
Thanks
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
Hi,
I am placing a bitmap on a button using LoadBitMap and SetBitMap.
The problem is that when I draw the bitmap, I want the background to be transparent so it will appear nice on the button.
From some reason, the "Draw Opaque" is checked by default in VisualStudio on the "Image" menu and I can't change it.
How do I use a transparent background on a bit map I am drawing.
Shay
-- modified at 14:40 Monday 12th December, 2005
|
|
|
|
|
Im having problems with a scroll bar issue. I have 3 scroll bars in a dialog, and i added a OnVScroll() method to my code to do some resricting of the scroll bars at certain times. But the problem is i only get 0's back.
void CScanPatternDlg::OnVScroll( UINT nSBCode, UINT nPos, CScrollBar *pScrollBar )<br />
{<br />
int low, high, curPos;<br />
CSliderCtrl* slider = (CSliderCtrl*)pScrollBar;<br />
<br />
<br />
slider->GetScrollRange( SB_VERT, &low, &high );
high = slider->GetScrollLimit(SB_VERT);
<br />
<br />
switch( nSBCode )...
also nPos = 0, which is supposivly the current position of the scroll bar. Also when i call getPos() on pScrollBar, it returns 0. I've fiddled around a little bit, and noticed that pScrollBar is equal to the HWND of the right scroll bar, so i guess i dont get why these methods arent working.. Any ideas?
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
greetings,
1. Is a CSliderCtrl kinda a CScrollBar?
2. Do child controls of a dialog window reflect messages to the parent window?
3. Can class wizard connect the CSliderCtrl messages to the parent window?
|
|
|
|
|
I wrote a simple program that cycles through a bunch a bitmaps and displays them each for 5 seconds. The program can run for hours. The problem is that the i can't stop the program once it starts (beside hitting the X and crashing). While inside the for loop, the menu is ignored. I'm sure this is common and there's a simple way to check for user input but I can't find it.
|
|
|
|
|
put the loop into it own thread... this way, it doesn't block the UI...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
then in the loop (that's in its own thread), have it check some static variable or something that gets set to true when a certain button is pressed. Then add that variable as part of the criteria for your loop to continue looping
My articles
BlackDice
|
|
|
|
|
Greetings,
you have to allow the message pump of the main window run; Either dispatch messages from your bitmap loop; check msdn for pumpmessage;
|
|
|
|