|
But
LPCTSTR A 32-bit pointer to a constant character string that is portable for Unicode and DBCS.
I need unsigned char* type.
Could you explain more detail with example? Please!
|
|
|
|
|
CString str;<br />
str=_T("abc");<br />
<br />
unsigned char *s; s=(unsignedhar*)str.GetBuffer(str.GetLength()+1);<br />
::AfxMessageBox((LPTSTR)s);<br />
|
|
|
|
|
rather than doing C-type caste.
unsigned char *s=reinterpret_cast <unsigned char*> ( str.GetBuffer(str.GetLength()+1));
-- modified at 2:42 Friday 14th October, 2005
|
|
|
|
|
For example
If the content of str is 0x30 0x31 0x40 0x50,
the content of s will be 0x30 0x00 0x31 0x00 0x40 0x00 0x50.
How to solve it?
Please help!
|
|
|
|
|
the internal pointer of str and s both are pointing to same memory location
|
|
|
|
|
In fact that I need to put the unsigned char* into a byte array.
Is it the UNICODE problem?
Do you know any good method to put the data into unsigned char* and byte array?
Please help!
|
|
|
|
|
|
I have already used the CByteArray, but I have some data in CString format or char format. So I need to convert them into Byte Array.
|
|
|
|
|
is your project build under unicode?
if no
the return value returned by getbuffer can be considered as byte buffer.
unsigned char* p;
*p=' ';
or p[0] = 'A';
-prakash
|
|
|
|
|
Yes!
After I change back to MBCS, it work now.
Thank you very much!
|
|
|
|
|
Guys,
I have a VC++/MFC app that connects to a SQL Server database. My application needs to take some action when a particular table in the database is inserted with a new record.
The traditional method would be to continously check the table that I am interested in and pull the record out. Is there any other way by which my app can be notified when a particular table on the database is inserted with a new record.
Thanks a bunch in advance for reading through my issue,
Best,
Mustufa Taj
Software Developer
|
|
|
|
|
Just a thought, can you set up a trigger in the database?
A trigger that fires at an insert-command?
And then make that database trigger to fire an event that you can catch in your program?
If it's possible, it seems to me as the most effecient way to do it.
|
|
|
|
|
kakan wrote: Just a thought, can you set up a trigger in the database...it seems to me as the most effecient way to do it.
I agree.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
Hello, everyone!
When I run my program in debug mode, (use vc7), the
debugger say : can find xxx.dll, this dll is used in my
program, how can I let the debugger find the dll?
where should i add the dll path?
Please tell me , thank you!
|
|
|
|
|
add the dll file to your solution/project; just like u add cpp/h files.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
Thank you for your replay.
If I add dll to the path of my project's exe, it is ok.
But I donn't think it's a good way to resolve this problem.
I think perhaps VC7 had some where I can add dll's path,
and when in debug mode, it can find.
But where? do you know?
|
|
|
|
|
chenxiujie wrote:
I think perhaps VC7 had some where I can add dll's path,
and when in debug mode, it can find.
how are you calling the DLL from your project i.e. are you are using LoadLibrary or GetProcAddress combination or provides Project with DLL lib file.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Sorry, I donn't know the meaning of yours "provides Project with DLL lib file", can you explain it first? Thank you.
|
|
|
|
|
when you link the dll statically(you don't link it with LoadLibary), then you need this *.lib file to compile.
for your case, seems you link it dynamically,if you want to compile that dll also, I recommond you group that dll project to your project and output files to a same directory, or you have to add the dll file to your output file's directory.
life is just like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
Thank you.
I know your meaning, and now I just put the dll into the
exe path, it can be debug now.
This problem is made by others , what I do is add some functions to it. I feel very strange for one things:
when it compile in release mode, it compile with *.lib,
but when it compile in debug mode , it compile with *.dll
I donn't know why did as thest.
It's a service program, and when it run in debug mode, it always exit at the function: "::StartServiceCtrlDispatcher()"
But in release mode it can run normal,
Do you know the reason , can you help me, thank you!
|
|
|
|
|
Did you only add it to the debug configuration? If so make sure it is in the release configuration as well.
Elaine
The tigress is here
|
|
|
|
|
Thank you.
But in release mode it use *.lib, not *.dll.
So I donn't need to add in release configuration.
|
|
|
|
|
The NULL Developer wrote:
add the dll file to your solution/project; just like u add cpp/h files.
How can you add DLL to a Project ? ..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Project->Add to Porject->Files, in the dialog box, set filetype to "Executable files", choose your dll, it is added to the Project.
~RaGE();
|
|
|
|