|
/*The Compiler errors is:
fatal error C1070 mismatched #if/#endif pair in file '**/*/****'
hope you can help!*/
#ifndef _WINSOCK2_H
#define _WINSOCK2_H
#define _GNU_H_WINDOWS32_SOCKETS
#ifdef __cplusplus
extern "C" {
#endif
#include <winsock.h>
#define FD_MAX_EVENTS 10
#define FD_READ_BIT 0
#define FD_WRITE_BIT 1
#define FD_OOB_BIT 2
#define FD_ACCEPT_BIT 3
#define FD_CONNECT_BIT 4
#define FD_CLOSE_BIT 5
typedef struct _WSANETWORKEVENTS {
long lNetworkEvents;
int iErrorCode[FD_MAX_EVENTS];
} WSANETWORKEVENTS, *LPWSANETWORKEVENTS;
typedef HANDLE WSAEVENT;
#define WSACreateEvent() CreateEvent(NULL, TRUE, FALSE, NULL)
/* etc */
int WINAPI WSAEnumNetworkEvents(SOCKET s, WSAEVENT hEventObject, LPWSANETWORKEVENTS lpNetworkEvents);
int WINAPI WSAEventSelect(SOCKET s, WSAEVENT hEventObject, long lNetworkEvents);
//ifdef __cplusplus
#endif
#endif
#endif
#endif
#endif
}
|
|
|
|
|
there are too many #endif ...
you need to have one #endif per #if ( or #ifdef or #ifndef )
at the end you should have something like :
#ifdef __cplusplus
}
#endif
#endif
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thx. It worked on the file but now errors have appeard every were. I have an error in the tchar.h file, atalloc.h. I meen these files
weree made by Microsoft! Whot's happening here!
|
|
|
|
|
check all you other .h files, be certain to match #if ( #ifdef, #ifndef ) with #endif
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
do someone you know where to get sub seven open source
|
|
|
|
|
How do i extract the source code from an .exe file. Is that available throgh the exe format? any links? - Thanks! -V.G
|
|
|
|
|
|
Then how do source code and resource hackers work...? V.G
|
|
|
|
|
Resource 'hacking' is a different story. Windows has a defined interface (UpdateResource [^]) for modifying resources in executables.
Software Zen: delete this;
|
|
|
|
|
V.G wrote:
source code
do u seen any s/w which reveal you source code of application ?
if this possible, then new MSCP Window is coming next month ?
yeah it possible to to hack resource, UpdateResource api will help,but it's work on Win2000 and above plateform only
"I Think Believe this Will Help"
[Vote One Here, Complete my Survey....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
For compiled C++ programs, this isn't generally possible. The compiler translates C++ source code into machine language. The resulting machine language does not contain sufficient information (at least in code compiled for release) to reconstruct the original source.
For .NET programs, compiled into IL, I believe it is possible to decompile those programs.
Software Zen: delete this;
|
|
|
|
|
I would like to enumerate the IP addresses for printers on my LAN. Can someone reference an article that might help?
|
|
|
|
|
Sorry for the post, I found an example elsewhere.
|
|
|
|
|
I'M VERY FRUSTRATED !! Using VC++ 6.0 - I have looked EVERYWHERE to see how to reactivate the dialog controls palette, but can't find any reference to it. (So REALLY REALLY stupid !!!) Please point me in the right direction !!!
Doug
|
|
|
|
|
Go to Tools, Customize, Toolbars tab, check 'Controls'.
Software Zen: delete this;
|
|
|
|
|
Thanks Gary, I just found it (literally 2 seconds before I saw your reply !!)
Doug
|
|
|
|
|
Hi guys,
I am developing a program that replaces executables icons with icons from other applications (executables) or from icon files. For now I am using this code in order to do it:
<br />
HMODULE hLibrary;<br />
HRSRC hResource;<br />
HGLOBAL hResourceLoaded;<br />
LPBYTE lpBuffer;<br />
HICON hIcon;<br />
int skip=0;<br />
<br />
hLibrary = LoadLibrary(icon);<br />
if((int) ExtractIcon(AfxGetInstanceHandle(), icon, (UINT) -1))<br />
for(unsigned long n=0;n<=1000000;n++)<br />
{<br />
hResource = FindResource(hLibrary,MAKEINTRESOURCE(n), RT_ICON);<br />
if(hResource)<br />
if(skip==IconIndex)<br />
n=1000001;<br />
else<br />
skip++;<br />
}<br />
else<br />
MessageBox("The icon file or the first file contains no icon");<br />
if(hResource)<br />
{<br />
hResourceLoaded = LoadResource(hLibrary,hResource);<br />
lpBuffer = (LPBYTE) LockResource(hResourceLoaded); <br />
hIcon=CreateIconFromResource((PBYTE)lpBuffer,SizeofResource(hLibrary,hResource),1,0x00030000);<br />
<br />
HANDLE hUpd=BeginUpdateResource(my_name,0);<br />
UpdateResource((HMODULE)hUpd,RT_ICON,MAKEINTRESOURCE(1),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),lpBuffer,SizeofResource(hLibrary,hResource));<br />
EndUpdateResource(hUpd, FALSE);<br />
}<br />
FreeLibrary(hLibrary);<br />
So now I am using LoadLibrary, FindResource, LockResource to extract icon from executable or dll and then I use UpdateResource(...) to write icon to new exe. The problem is that this options does not suport icon files (.ico) and also it doesn't allow the user to extract the specified icon. I am using ExtractIcon() to get icon number.
Another way, more efficient and better would be to use ExtractIcon() to get icon form exe, dll or ico file. The problem of this mettod is that ExtractIcon() does not return a pointer to the data to be written by UpdateResource(...) instead it returns a HICON handle.
My question is how could I write this HICON handle to the new exe using UpdateResource(...). Itried several different methods but achieved one worked?
Please help anyone, this is very important to me.
Thanks.
|
|
|
|
|
Hi,
What I need to do is schedule some files to be deleted either at shutdown or at startup. My application can't do this because it is closing after it creates them and they need to remain there until shutdown. My app is currentlly creatting bat files for each of them and adds them to Startup folder in Start Menu. This method is inneficient though. For example how do uninstallers delete their executable at shutdown (startup)???
Thanks,
Andrew
|
|
|
|
|
you can run an application as windows starts up
you make an entry in registry
HKEY_LOCAL_MACHINE\Software\Microsoft\windows\CurrentVersion\Run
in this key you make an entry and give your applications full path ,
this application now will run every time you start computer.
Have a good luck.
|
|
|
|
|
I can't use another app that deletes the files due to project specifications. I need somenthing more simple. I have been using bat files until now the console window showing at every startup was annoying. Is there a way to hide this window?? How do uninstallers delete their own bodies after uninstall??
|
|
|
|
|
Anonymous wrote:
How do uninstallers delete their own bodies after uninstall??
See MoveFileEx() [^]
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Be carefull with the "MovefileEx" with the MOVEFILE_DELAY_UNTIL_REBOOT
From MSDN:
This value can be used only if the process is in the context of a user who belongs to the administrator group or the LocalSystem account.
|
|
|
|
|
Thanks, guys it worked.
Nemok
|
|
|
|
|
Remeber One thing MoveFileEx only Work In Windows Multiuser Editions,if you are targeting your application to Win98 then for deleting file at Startup you have to write the entry in the WinInet.ini
It's an INI file, however for deleting it's harder because the format is:
[rename]
NUL=C:\\temp\\file1.exe
NUL=C:\\foo\\file2.exe
and so on. You can't use WritePrivateProfileString()because
the second NUL line would replace the first. You need to read
the whole file in,modify it, and write it back it again
"I Think Believe this Will Help"
[Vote One Here, Complete my Survey....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
This seems to be something that's too simple to find an answer to, but it's starting to annoy me. All I know about C++ is what I've picked up myself, and I've never figure it out.
What's the difference between the types of include statements in C++? There's <thing>, <thing.h>, "thing.h", "c:\code\thing.h" etc. What's the difference? I know there's a difference, because changing the type has an effect on compiling.
Additionally, say I have a whole bunch of header files in a folder separate from where I'm working. Is there a way to set an environment variable or something so I don't have to type in the path to each one in its include statement?
Thanks for the help.
|
|
|
|