|
Can't you just use Word for this? If not, you may get lucky and find the file's format at www.wotsit.org.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Is there a way to check if file exist in c?
I have no idea
|
|
|
|
|
jinxmanh wrote:
Is there a way to check if file exist in c?
Which 'C'
Windows Based (Win32Api)-PathFileExists
In Dos Based 'C'-
here is Smmall COde
<br />
FILE *hFile=NULL;<br />
<br />
hFile=fopen(FileNamewithpath,"r" );<br />
if(hFile==NULL)<br />
{<br />
printf("file Doesnot Exists");<br />
return;<br />
}
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ThatsAlok wrote:
FILE *hFile=NULL;
hFile=fopen(FileNamewithpath,"r" );
if(hFile==NULL)
{
printf("file Doesnot Exists");
return;
}
Not true. fopen() will return NULL on error. The error could be anything, not just that the file does not exist. ie, it could be opened in exclusive share mode by another app.
A better way is to use _access().
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
Not true. fopen() will return NULL on error. The error could be anything, not just that the file does not exist. ie, it could be opened in exclusive share mode by another app.
Sorry, I Will take Note Of it.
Thanks
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
PJ Arends wrote:
fopen() will return NULL on error
And errno will have a value of 2.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi everyone:
Can someone tell me how to enable/disable tab stop for a specified dialog control? Please don't tell me to set this in the property of the control, I need to do this through some codes. Thanks!
|
|
|
|
|
After posting the question for a while, I found the CWnd member function ModifyStyle() may realize this function by removing the WS_TABSTOP style from the specified control. Is that right?
|
|
|
|
|
yes.....
use the ModifyStyle() function...
if the optionis initially there.....
then write it as .....
ModifyStyle(WS_TABSTOP ,0);
dont see y it shouldnt work.....
try it.....
happy programmin.....
cheerz.....
|
|
|
|
|
I have a dialog, which starts modeless subdialogs. They run nicely, but they always stay on top of the parent, even when the parent has the focus (I can type in data in a control of the parent window, if I move the child enough to the side).
I trapped WM_ACTIVATE and issued SetWindowsPost(&wndTop...). This gets the control and works almost well (it moves the window If I want to), but it still remains under the children.
What else do I have to do in order to win over the children?
|
|
|
|
|
Make the subdialogs parent while creating them as the desktop window by calling GetDesktopWindow() i guess that should fix the problem.
-prakash
|
|
|
|
|
That works well (although I wanted to avoid seeing the subdialogs on the task bar, but I can solve that otherwise).
Thanks you.
I wanted to rate your response, and accidentally clicked on "1". Sorry for that.
|
|
|
|
|
"I wanted to rate your response, and accidentally clicked on "1". Sorry for that."
nevermind.
-prakash
|
|
|
|
|
I have a situation where users are trying to create large 24bit DIBs (10,000 x 10,000) or greater and CreateDIBSection is failing. The problem appears to occur when virtual memory gets low. I can create the large DIBs when I don't have a lot of memory allocated for other things. I tried using the following:
HANDLE hFileMap = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, dwStorageSize,NULL);
dwLE = GetLastError();
if(INVALID_HANDLE_VALUE == hFile)
hFile = NULL;
if( NULL == hFileMap)
ErrMsg( dwLE);
LPVOID pDibBits = NULL;
HBITMAP hBitmap = ::CreateDIBSection( NULL, m_bitmapinfo, DIB_RGB_COLORS, pDibBits, hFileMap, 0);
dwLE = GetLastError();
The thought was that using CreateFileMapping() to allowcate memory for the DIB bits when memory was low but it still fails and GetLastError() return 0 which does not help. Is there a way to use swap file or temporary disk files as storage space for DIB bits when processing large bitmap files?
|
|
|
|
|
Its not a question of having enough RAM, you need to have enough address space available in your process. I think you won't have this issue on a 64 bit OS and a 64 bit process. Even a 32 bit process on a 64 bit OS helps as long as the process is Large Address Aware.
|
|
|
|
|
Hey,
While executing my program the debugger states that the program "...UserInterface.exe" has exited with code -1 (0xFFFFFFFF). I'm executing this program after a period of about 4 months. It was working fine when I left it. The only thing thats changes is that I had reformatted my computer and reinstalled windows. I have changed all the path changes made in the code.
Any idea why this happens?
Regards
|
|
|
|
|
Hey,
Never mind the question. Found the bug.
Thanks...
|
|
|
|
|
Can anybody point me to some example code or give me some tipson how to get a .jpg blob from an Access database into a static (picture) control?
Thanks in advance,
John
|
|
|
|
|
what program should I use to block my I.P. adress? Is ghost surf a good program?
thanks,
T.K.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...Where is the light?
I Wonder,
if it's weaping somewhere...
|
|
|
|
|
I htink you can LOkk for any FireWalls,search for free FireWall at Google
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hey, we're talking about how to program, not how to use programs...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How can i put a control, as CEdit, into an CMenu Item?
Thanks at everyone...
|
|
|
|
|
why on earth would you want to put a CEdit in a CMenu item ?!?!?!
me think you need to completly recode and redesign the menus.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
I'm interested in creating a window which is always on top. I've used SetWindowPos() which results in a stay-on-top window. This doesn't work (i.e. the window is not visible) however, with applications which make use of DirectX full screen exclusive mode as the DirectX app takes precedence over the stay-on-top window.
It would seem like DLL injection and API hooking may be what is required for this. i.e. inject into applications and hook the DirectX present() call, thereby allowing your app to render things on top of the DirectX display. I've seen some apps which appear to be doing this and they seem to work fine.
The problem there is that I don't simply want to render simple graphics/text on top of the DirectX display. I'd like the window itself to display and be useable. It would seem you'd need to render and capture events to really allow the user to interact with the window. Of course, if this is not feasible, at least rendering some simple text/graphics would at least be acceptable.
Anyway, just wondering if anyone knows of any sample/packaged code which takes care of this for you (either the simpler case of just rendering on top of DirectX or the more complex case of actually presenting an interactive window on top of DirectX).
Also, note that it would need to work regardless of whether such a DirectX app is running. i.e. it would still be necessary to have the normal window up with the stay-on-top attribute, and then have the DirectX interaction activate only while an app is using DirectX fullscreen exclusive mode.
|
|
|
|