|
Chris Losinger wrote:
you can't.
you uderstood the question ????
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
CString uses 8 bits! A byte is 8 bits and CString uses no less... If you want to specify values other than the visible characters, you should call GetBufferSetLength(new length) . This will retrieve a pointer to the internal character buffer. Manipulate it as required (using code>unsigned char's and a lot of casting. Then call ReleaseBuffer() and make sure that there are no null terminators in the buffer, but only one on the end.
This is a dirty hack that you should not use, but use a BYTE buffer or
unsigned char<code> buffer instead!<br />
<br />
Hope this helps :) <br />
<br />
Behind every great black man...<br />
... is the police. - Conspiracy brother<br />
<br />
<br />
<a href="http://www.codeproject.com/script/profile/whos_who.asp?id=418947&id=418947&df=100&forumid=27215&exp=6&select=1050632">Blog</a>[<a href="http://www.codeproject.com/script/profile/whos_who.asp?id=418947&id=418947&df=100&forumid=27215&exp=6&select=1050632" target="_BLANK">^</a>]
|
|
|
|
|
Hello,
I need to use CString because I use the VT_BSTR of VARIANT for using com port.
So could you tell me how to solve this problem or other method to do the com port program?
Please help!
Many thanks,
Alex
|
|
|
|
|
Hi Alex,
Try the following:
VARIANT var;<br />
CString str = "My serial data";<br />
var.vt = VT_BSTR;<br />
var.bstrVal = str.AllocSysString();
There's a lot written about serial programming here: http://www.codeproject.com/system/#Hardware+programming[^]
Hope this helps
--
Roger
|
|
|
|
|
Hi
Now I can send the data to com port in binary form,
CByteArray btArray;
int total;
total=GetDlgItemInt(IDC_EDIT1,NULL,TRUE);
btArray.Add(total);
COleVariant var(btArray);
m_comm.SetOutput(var);
VariantClear(&var);
but I can't receive in correct way.
Please help!
|
|
|
|
|
Alex Hon wrote:
I can't receive in correct way
What does this mean? Who is the receiver?
If you're having trouble with VARIANTs and MsCommCtrl, describe them.
What does the vt field in the VARAINT union say about how the data should be interpreted?
--
Roger
|
|
|
|
|
Hi Roger,
For example, I send the data is 0x8f (binary is 10001111).
I check the data in the line is 0x8f.
But I will get a 0x01 in VARIANT in receiving PC.
If the data is between 0x00 to 0x7f, it will be correct.
Please help!
|
|
|
|
|
You need to change the mode of the MsCommCtrl from text to binary.
Also be careful when calling GetInput how the VARIANT union should be interpreted. I suspect that the binary data will be a SafeArray.
I always write my own serial port handler since I consider the MsCommCtrl to be slow, to limiting and not very well documented to say the least.
E.g. you can have COM ports from COM1 to COM255 in the OS, but MsCommCtrl can only handle COM1 to COM16. Connect som devices such as a mobile phone, BlueTooth dongle and you easily get more than 15 ports.
Hope this helps
--
Roger
|
|
|
|
|
Thank you very much!
By using SafeArray.. , the receiving part is working now.
Thank you very much again!
|
|
|
|
|
Hallo Community,
does anyone have experience with Exception 0xE06D7363, when run in debug modus, the output window shows this message:
First-chance exception in LinkChek.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
and i dont know what kind of error is this???
thanks for help
break;
|
|
|
|
|
Hello,
You probably screwed something up in an API call. Some of the parameters might have incorrect values. It is impossible for me to say what is wrong from this point of view. Try to step into the debugger and see when the exception occurs, post more info on this later.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hello Bob,
thank you for answer, i try to debug step by step, maybe i can find the point where is error created, and i post a pease of code here!
regards
break;
|
|
|
|
|
Importing a dll which was has an enum with a German Umlaut (like 'ä') makes no problems using Visual Studio .Net 2003, but causes Visual C++ 6 to an error (error C2018) which means 'unknown character'. So the .tlh file is generated within every build I have no chance to modify it. Even setting this file to read-only causes the compiler to make problems. Does anyone know a solution for Visual C++ 6 to make the dll work e.g. a setting in the project ( Win32 MFC Project Dialog based) ?
|
|
|
|
|
Hi!!
I'm trying to figure out a way of removing symbols from a standard library. I've only been able to extract whole object modules from the library at the commandline like so:
lib name.lib /extract:module.obj /out:result.obj
or remove entire object modules like so:
lib name.lib /remove:module.obj /out:result.lib
I'm trying to remove a DllMain implementation from the library because I need to create my own in the dll that uses the library. I get linker errors saying that i've got a multiply defined symbol i.e. _DllMain@12 (similar to what you'd expect). I can't remove the object module that contains it because it also contains symbols that i need.
Does anyone have any idea how to get around this? I may be going about it all wrong!?
Thanks!!
|
|
|
|
|
Why not encapsulating the DLL instead of messing around? You'll most probably receive an updated version of the file with the next Service Pack, and you'll need to do the work again. I'd rather write my own DLL that simply calls the standard one, are there any obstacles here?
Regards,
BB
http://spin.bartoszbien.com
|
|
|
|
|
there are a few 3rd party libraries (.lib's) that either perform the linking / mapping to symbols in dlls, or actually contain code. the library that actually contains code (that i need) also contains the DllMain, but as i mention, i really need to implement my own DllMain. So in other words my own dll encapsulates functionality provided by the other dlls AND libraries, but i can't dynamically link to all symbols, because they're actually provided within a .lib.
is there any way of extracting/removing symbols from .lib's/.obj's that i need/don't want?
|
|
|
|
|
|
I'd imagine object modules within libraries are included in the resultant exe/dll as are those that are generated during compilation of project code!?!? In which case, ALL symbols specified to the linker (directly/indirectly) would be included.
Any ideas??
|
|
|
|
|
hello!
i am new to mfc programming. i want to know "how to convert ini files into xml files by using mfc". i am working on windows xp platform.plz help me
thanx
|
|
|
|
|
hello!
i am new to mfc programming. i want to know "how to convert ini files into xml files by using mfc". i am working on windows xp platform.plz help me
thanx
|
|
|
|
|
hey swaapu u have posted the message twice.........
will send u feedback if i get it for converting
the ini--> xml by mfc
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
vikas amin wrote:
will send u feedback if i get it for converting
the ini--> xml by mfc
hey, are you too tired to come to the forum and read what you want ?
don't you want us to eat in your plate and f**k you wife too ????
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
don't you want us to eat in your plate and f**k you wife too ????
Tox, this was not you posting this, was it ? I am not used to you answering like that ...
~RaGE();
|
|
|
|
|
hummm, hem, what ? who is speaking ?
oh, hello dear Rage
ok, i was a bit too hard in my post but hey, this is a forum or not ? if this is a forum (what i deeply suspect to be) why one would forward to another the answer he could have been given ? i find exactly the same as asking something on a forum, and ending your post by giving your email....
d'you understand what i mean ?
if the guy cannot come back to the forum and see the answer he was seeking, so maybe he needs someone to handle his fork, take the food in his plate, put into his mouth... (or much... )
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
d'you understand what i mean ?
Would it have been too much for you to have simply ignored the thread?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|