|
cyn8 wrote: By using PathFindExtension() and PathFindFileName(), the error"error C2039: 'PathFindExtension' : is not a member of 'CString'" is generated.
I never implied they were CString methods.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hey guys,
im trying to build a project with a .lib file included. however, when i try to run the project i get
"This application failed to start because _______.dll was not found. Re-installing the application may fix this problem"
under properties -> librarian -> general, i have the library under "additional dependencies" and under "additional library directories" i have the file path to the library...
any ideas?
------------------------------
I win because I have the most fun in life...
|
|
|
|
|
Is this with VS6 or VS200x?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
this is with VS2005
------------------------------
I win because I have the most fun in life...
|
|
|
|
|
VonHagNDaz wrote: under properties -> librarian -> general, i have the library under "additional dependencies" and under "additional library directories" i have the file path to the library...
These are build-time settings.
The error is a run-time error - the system can't find a dll the application requires to run.
Where is the missing DLL?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
the dll file is in the folder containing the lib, which is a separate folder than the project
------------------------------
I win because I have the most fun in life...
|
|
|
|
|
It should work if you move the dll to the same folder as the exe.
The documented search path order for dlls at runtime is:
The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. Windows Me/98/95: This directory does not exist.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
putting it in the directory worked. thanks.
general programming practice question:
once this utility is complete, it will need at least 20 more dlls for the different printer libs. what i was trying to do was link each lib from their path in the repository. will i have to add each dll to the executable directory, or is their a cleaner way so when the libs are updated i wont have to recopy the dlls.
------------------------------
I win because I have the most fun in life...
|
|
|
|
|
Linking the import libraries is done at build time so you're fine there. If it links, you're
good!
Runtime, however, you'll need to make sure the DLLs are in the paths indicated by the search
sequence I mentioned.
Loading DLLs at runtime with LoadLibrary (Run-Time Dynamic Linking)[^], you have more flexibility
since you can specify a path that's stored in the registry, or better yet, stored where you're
supposed to - in the shell "special" folders.
In this case though, the DLLs are bound at link time (Load-Time Dynamic Linking)[^] so you'll
need to have the DLLs available somewhere in the search path. The exe folder is always easiest
but not always convenient. Modifying the PATH environment variable is an installation-time
thing - so is specifying a current directory at application startup. With newer security issues,
I'm not sure what the current stance is on putting them in the Windows system directory. That
used to be where everyone dumped all their common DLLs
Whatever best fits your needs (vague, I know)
*edit* Also search on "DLL Hell" for more info and tips on avoiding it )
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
thanks man. much appreciated
------------------------------
I win because I have the most fun in life...
|
|
|
|
|
You're welcome! Good luck
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
How can I paint a button,tab control etc.For example I want to change the color of background and text of a button.I saw that CWnd::OnCtlColor method was used in somewhere but I couldn't apply it in my project.How can I use this method or how can I change colors of controls easily.
Thanks
|
|
|
|
|
WM_CTLCOLORBTN you can set a button's text and background color
WM_CTLCOLOREDIT for edit control
WM_CTLCOLORLISTBOX for listbox
|
|
|
|
|
In my application i am using stretchblt bitmap function. it works fine in windows xp and 2000. But it fails in windows 98. Can anyone help me to solve this?
|
|
|
|
|
fails how? Can you post the code you use to set up the DCs and make the StretchBlt call?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
This is the code i am using
pClientDC->StretchBlt(iUnitXPos, iUnitYPos,iDisplayWidth, iDisplayHeight, pMemDC, iMemDCXStart, 0, iOrigBmpWidth, iOrigBmpHeight, SRCCOPY);
where,
pClientDC - window dc which comes from ondraw function of the view.
pMemDC - memory DC created as follows
pMemDC = new CDC;
pMemDC->CreateCompatibleDC(pClientDC);
Thanks
|
|
|
|
|
Assuming pClientDC is valid, you can check (as Blake suggested) for StretchBlt capability
like this:
if (pClientDC->GetDeviceCaps(RASTERCAPS) & RC_STRETCHBLT)
{
// StretchBlt supported
}
else
{
// StretchBlt NOT supported
}
Also make sure all passed parameters are valid.
If StretchBlt returns FALSE, what does GetLastError() return?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks.
I found a problem with the parameters i passed to the stretch blt function and corrected it. Now the bitmap is displayed in windows 98.
I am facing some other problem. CDC::DrawText function crashes sometimes.
|
|
|
|
|
PrabhuDev wrote: I am facing some other problem. CDC::DrawText function crashes sometimes.
Are all the passed parameters good? Do you get any assertion and/or error message?
What does the code look like?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I have developed my application in Xp. I am running only the release build in windows 98. This is the function i am using to display the text.
DisplayText(CDC* pDC, const CRect& rect, const CString& strText)
{
ASSERT(NULL != pDC);
int iPrevMode = pDC->SetBkMode(TRANSPARENT);
COLORREF clrTextColor = RGB(255, 255, 255);
pDC->SetTextColor(clrTextColor);
CRect rectDisplay = rect;
rectDisplay.NormalizeRect();
CString strTextOut = strText;
pDC->DrawText(strTextOut, rectDisplay, DT_CENTER|DT_SINGLELINE|DT_BOTTOM);
pDC->SetBkMode(iPrevMode);
}
sometimes the function crashes in the drawtext function.
|
|
|
|
|
Are all the passed parameters good?
Do you get any assertion and/or error message? What do you mean by "crashes"?
Is the HDC valid in pDC? Try adding ASSERT(NULL != pDC->GetSafeHdc()); to check.
Run a debug build on the 98 machine. Running a release build makes your ASSERTs useless.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Maybe not supported by video card - I think you are supposed to check that out first.
I think we ended up using CopyBlt or something like that to 'stretch' it - the stretchblt call is not always supported direcly on Windows 98. I tmight be up to the video driver to support it, and some don't.
|
|
|
|
|
Hi!
I am working on a 3D engine for an RTS game using DirectX 9 and I have decided that I will be making the engine modular using .dll files for parts such as the renderer. The problem with this, is that the game is going to have a multiplayer aspect and therefore, I need some way to verify the integrity of a .dll file such as "renderer.dll" to ensure that the file has not been replaced with a third party .dll (basically a hack) that can display wireframe views or remove the fog of war, etc.
The reason I am making the engine modular is so that users will not have to download large updates to fix small issues, but can instead simply download the updated .dll that corresponds to the error fix.
So far the only method I have come up with for this error checking is to either simply redownload all files every time the user launches the game (horrible idea), or to somehow check the file against the server copy.
So I was wondering, do you guys have any ideas of how to achieve this?
|
|
|
|
|
Keep a table of DLL->MD5 mappings. If one does not match, then refetch the offending DLL. Update this table as your DLL are changed at the server. Just download the table and do the check each time. No need to get all the files that way.
|
|
|
|
|
Keeping MD5's (or some other hash/signature/digest) on the server and then comparing as Blake Miller suggested is what I would recommend as well.
However, the paranoid in me would also suggest that you compare the MD5s at different parts in the game, just to help keep hackers at bay. For example, check not only at launch/startup to download the correct versions, but also verifying the signatures of different binaries at specific time intervals during play (check only, do not download because the game is in progress).
Just my $0.02...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|