|
#define APP_TEST APP_TEST1 " With " APP_TEST2
|
|
|
|
|
|
be really careful with macros, because it is hard to debug and in can lead to really bogouis errors.
=>
//const LPTCSTR APP_TEST1 = L"Test1";
const LPCTSTR APP_TEST1 = L"Test1";
...
Code quality is also an important issue
Press F1 for help or google it.
Greetings from Germany
modified on Friday, March 19, 2010 3:30 AM
|
|
|
|
|
KarstenK wrote: const LPTCSTR APP_TEST1 = L"Test1";
It should be LPCTSTR .
|
|
|
|
|
Good catch
|
|
|
|
|
Hi;
I am working on a project involving a PC onboard a robotic vehicle transceiving (say using Wifi 802.11 connection) sensors' info to another PC housed in another moving vehicle. There are data exhchanges in both directions in real-time. I am totally new to networking/comm between PCs. Please point me to sample code/tutorial on this topic.
Thanks.
Fun Wey
|
|
|
|
|
|
I have a function that will be called for all sorts of windows (it gets the HWND), and I want it to process only static icons, but not other types of controls like buttons, combos, etc. There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
can i convert unicode string to multibyte?
|
|
|
|
|
I like to use WideCharToMultiByte[^] Величие не Бога может быть недооценена.
|
|
|
|
|
or
WideCharToMultiByte[^] ... txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
|
or use like this:
#include "StringA.h"
#include "StringW.h"
CStringW sTestW( L"Test" );
CStringA sTestA( "Test" );
CStringW sConvertW = sTestA;
CStringA sConvertA = sTestW;
</pre>
|
|
|
|
|
I have displayed a bitmap on the screen.Now i want to save it in the harddisk after performing some painting operations on it.How do i achieve this?Please help.
Thanking you in advance,
Ashwath.
|
|
|
|
|
Try it :
CImage::Attach(HBITMAP);
CImage::Save(LPCTSTR);
CImage::Detach(); virtual void BeHappy() = 0;
|
|
|
|
|
Please let me know if we can use CImage code in VS2008.
Thanks,
Ashwath.
|
|
|
|
|
Yes, just include <atlimage.h> virtual void BeHappy() = 0;
|
|
|
|
|
|
Hi all,
I was trying to make self deleting executable. I found a article on code project []
my problem is i am stucked at one place my folder is not getting deleted.
CString templ =
"del \"%s\"\r\n"
"taskkill /im selfdelete.exe\r\n"
"del \"%s\"\r\n"
"rmdir /S /Q \"%s\"\r\n"
"del \"%s\"" ;
CString tempstr;
CString modulename;
LPTSTR pPath = tempstr.GetBufferSetLength(MAX_PATH);
GetTempPath ( MAX_PATH, pPath );
tempstr.ReleaseBuffer();
tempstr = tempstr + tempbatname;
LPTSTR modulenm = modulename.GetBufferSetLength(MAX_PATH);
GetModuleFileName(NULL,modulenm,MAX_PATH) ;
modulename.ReleaseBuffer();
CString str = modulename;
int k = str.Find('\\');
while(k >= 0)
{
str = str.Right(str.GetLength()-k-1);
k = str.Find('\\');
}
CString folder = modulename.Left(modulename.GetLength()-str.GetLength());
CString iniFile = folder;
CString file = "\\selfdeletepath.txt";
iniFile = iniFile + file;
HANDLE hf ;
hf = CreateFile(tempstr, GENERIC_WRITE, 0, NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL) ;
if (hf != INVALID_HANDLE_VALUE)
{
DWORD len ;
CString bat ;
LPTSTR bBat = bat.GetBufferSetLength(MAX_PATH);
bat = (char*)alloca(strlen(templ) + strlen(modulename) * 2 + strlen(tempstr) + 20) ;
wsprintf(bBat, templ,iniFile, modulename, folder, tempstr) ;
WriteFile(hf, bat, strlen(bat), &len, NULL) ;
CloseHandle(hf) ;
ShellExecute(NULL, "open", tempstr, NULL, NULL, SW_HIDE);
}
}
can anybody please tell me what i am doing wrong.
thanks in advance
|
|
|
|
|
You can try SHFILEOPSTRUCT Structure
|
|
|
|
|
I smell this exe itself to be like a virus
Well i think you are doing something which is weird
ShellExecute itself, check the argument.
Well i am doubted about your logic of deletion.
I believe you can achieve the deletion in XP with a different logic.
Create a remote thread and attach to some other process before exiting your native executable, and then delete from that remote thread.
Just try that Величие не Бога может быть недооценена.
|
|
|
|
|
Dear all,
I have made a DLL using VS - 6. But it does not display any information when i go through by right click on it and goes to property. In case of other Microsoft DLL, that shows many info. So how can I set like author, version info etc.
Thanks to all
|
|
|
|
|
You have to modify you version section of the app resources:
Solution View -> app.rc -> ContextMenu ->
Open With -> Resource Editor -> ContextMenu ->
Add resource -> Version virtual void BeHappy() = 0;
|
|
|
|