|
Thanks guys !!!
It's exactly what I was looking for
|
|
|
|
|
I have some problem in my code .Due to my inexpereicne iam not able to solve it .
HANDLE hFile;
LPWIN32_FIND_DATA FileData;
hFile=FindFirstFile(str,FileData);
if(hFile==INVALID_HANDLE_VALUE)
{
FindClose(hFile);
return FALSE;
}
else
{
FindClose(hFile);
AfxMessageBox("File Does Exists ");
return TRUE;
}
This is a MFC application .This code is part of CMainFrame class in a fucntion .When the function returns TRUE ,the application crashes .Help me out please
|
|
|
|
|
The answer doesn't immediately spring to mind but, two points which may help...
1) I'm not sure that you have to call FindClose() when the handle returned is INVALID_HANDLE_VALUE.
2) Have you tried using the access() function declared in <io.h>. This can be used to check for the existence of a file too.
|
|
|
|
|
hi there
if you only want to check if the file is existing you can do that like that :
CString csMyFile = "c:\\temp\\some.file.dat";
CFileStatus statusFile;
BOOL bExists = CFile::GetStatus( csMyFile, statusFile );
return( bExists );
But i guess the crash is a result of that :
HANDLE hFile;
LPWIN32_FIND_DATA FileData;
hFile=FindFirstFile(str,FileData);
You should not only pass a pointer to FindFirstFile(..).
It must be a pointer to an existing WIN32_FIND_DATA-struct !!!
If you only pass a pointer to "SomeWhereInMemory" and FindFirstFile starts writing data about an existing file ... it writes to "SomeWhereInMemory" .... and that no good idea !
look at the VC++ MSDN-Help about FindFirstFile :
pFindFileData : Pointer to the WIN32_FIND_DATA structure that receives information about the found file ...
so write it that way :
WIN32_FIND_DATA FileData;
hFile=FindFirstFile(str,&FileData);
and i think it will work .... (without GPF).
|
|
|
|
|
I develop a system for graphic processing, I use TureType Font to output fonts by ploter,I use GetGlyphOutline fuction to get the font's outline, but it's too slowly for ploter to plot the font's outline. I hope to get vector single line font as it in AutoCAD. Can you tell me how to get and use it? thank you very much!
my mail: dirkey@sina.com
dirkey
Jon_Hu
|
|
|
|
|
I've been usinng OpenGL and SDL in many of my apps, but my friends use directX, and claim it's easier and more powerfull. Are they right?
Does anyone else still use the 8051 ?!?!!?
|
|
|
|
|
Well,
they CAN'T say Direct3D is easier than OpenGL...
also, you should check OpenGL updates on pixel shaders to see if one is more powerful than the other.
|
|
|
|
|
snood wrote:
Does anyone else still use the 8051 ?!?!!?
Some of my work projects are targeted at the 80552 which is an 8051 variant.
Does that count?
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
1. I am trying to load a B&W bitmap using LoadBitmap into a CBitmap variable. Because it is a B&W bitmap, I want to then set the foreground and background colors and so that I can load it into a DC and change its colors when I bitblt to the screen to whatever the foreground and background color is. However, this does not seem to work. It almost seems as if when the bitmap loads, it does not load it as B&W even though that is how I designate it in the resource.
Any ideas?
2. I am trying to get the System32 or some other directory using a API call but can't figure out which. Originally I thought maybe SHGetspecialFolderPath but it does not seem to list these directories.
Thank you in advance!
|
|
|
|
|
|
Or try SHGetSpecialFolder.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I setfocus same CEdits in a CDialog, but i use "SetFocus()" fail?
|
|
|
|
|
sunson wrote:
I setfocus same CEdits in a CDialog, but i use "SetFocus()" fail?
You aren't very clear, however you can call GetLastError() to see why. You may have passed an invalid HWND .
-Nick Parker
|
|
|
|
|
Thank you. I have solved it.
|
|
|
|
|
I am creating an application which uses a "modified MDI-style" interface (Multiple SDI Windows) as described on MSDN. I have only 1 main frame window, and then from there you can open other different types of frame windows. The problem is that for each new frame that is created (I create a new frame and then call
pFrame->LoadFrame(WS_OVERLAPPEDWINDOW,NULL)), it adds another item to the windows task bar! -- a behavior which i wish to avoid if possible. I find that if I pass in a pointer to the main window (LoadFrame(WS_OVERLAPPEDWINDOW, AfxGetMainWnd()) that it prevents this behavior, but causes an even bigger problem: any frame windows spawned this way are always on top of the main frame window and obstruct my viewing it even when its active! (even if i set its style to WS_CLIPCHILDREN and WS_EX_TOPMOST)
I wish to find a solution that gets around both of these problems and am recruiting anyones help who knows.
Thanks so much,
Ben
|
|
|
|
|
brigham_young wrote:
any frame windows spawned this way are always on top of the main frame window and obstruct my viewing it even when its active! (even if i set its style to WS_CLIPCHILDREN and WS_EX_TOPMOST)
WS_EX_TOPMOST should place the window above the other, you might try calling SetWindowPos() or using Create() instead of LoadFrame() .
-Nick Parker
|
|
|
|
|
Hello,
I use GDI+ with VC++.
But painting pictures speed is slow terribly.
"DashStyleSolid" is fast, but "DashStyleDot" is very slow.
It is very late besides "DashStyleSolid".
Time of big figure and a lot of figures is terrible.
Are there what or measures?
Thank you.
gata_Jzx90
|
|
|
|
|
That's just how it is, it seems. I think that on Windows 9x/ME/NT it has to create a new Windows GDI bitmap each time it draws. You can improve performance by caching the bitmap.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Thank you for an answer.
I paint pictures in Bitmap of GDI.
And I forward the Bitmap to DC with BitBlt.
However, it becomes very late by "DashStyle".
Can there be a thing that it becomes late by "DashStyle"?
Thank you.
gata_jzx90
|
|
|
|
|
Hello,
I have a binary file format that I am trying to develop a reader class for. The "word" size is always 8 bytes for double, integer or character values. I have written something like this for a file that uses 4 byte words, which is easier because an int=float=char=4 bytes.
Somehow I have to take the 8 byte word and split it into two 4 byte words and then cast? them to integers or characters.
double value
fread(value, sizeof(double), 1, m_fp);
// now get rid of the 4 bytes I dont need
// ....
Dont know if this will work or not... Any suggestions?
Ted
|
|
|
|
|
Assuming that it is little-endian:
char buf[8];
fread( buf, 8, 1, m_fp );
int nMyInt = *reinterpret_cast<int*>( buf );
If it is big-endian:
char buf[8];
fread( buf, 8, 1, m_fp );
int nMyInt = ntohl( *reinterpret_cast<int*>( &buf[4] ) );
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hey, I have a IE toolbar named KControl.dll and have just come upon a little program on Microsoft.com that will register it so that it can be used on another computer. Here is a link to the article:
http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q207132[^]
Right now the pszDllName is set to NULL. How can I make it so that it register's my DLL? I'm not quite sure what to add. Does the DLL have to be in the workspace? Any help would be greatly appreciated.
|
|
|
|
|
If you are doing this in your own code and already know the DLL's name, then you should only be interested in everyting below this line...
HINSTANCE hLib = LoadLibrary(pszDllName);
With pszDllName set to the DLL's path (including filename).
Jeremy Falcon
|
|
|
|
|
I'm still getting the same errors I got last time:
C:\WINDOWS\Desktop\Will's Folder\kazaatools\KControlInstall\Register.cpp(127) : error C2065: 'KControl' : undeclared identifier<br />
C:\WINDOWS\Desktop\Will's Folder\kazaatools\KControlInstall\Register.cpp(127) : error C2228: left of '.dll' must have class/struct/union type
I put HINSTANCE hLib = LoadLibrary(KControl.dll); (assuming they are in the same folder)
Do you know how to fix this? Thanks.
|
|
|
|
|