|
his post got messed up as he didnt use the < and > tags
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Your static_cast bits have gone awry. Repost except this time click on the "Display this message as-is (no HTML)" checkbox before you click submit.
--
Andrew.
|
|
|
|
|
How or better Where do i initialize Controls in a CFormView? e.g. I've got a ComboBox in my FormView and want to set the third icon out of 8. In a Dialog Box I'd call SetCurSel() in InitDialog. But there seems to be no function like InitDialog for a FormView! Please help me!
Thanks in advance,
Semlo
|
|
|
|
|
Override
CFormView::OnCreate
I vote pro drink
|
|
|
|
|
I've tried to convert a UINT to char and back again, it doesnt work, how many bytes in one UINT and how many bits per byte?
This sounds to be very simple but I'm not having luck!
|
|
|
|
|
Are you talking about a VC6 compiler?
Then UINT is 4 bytes. Each byte is 8 bits.
A char is a SIGNED 1 byte value.
What part of the conversion doesn't work? Aside from syntax error and loss of precision or funny business with the sign bit, there isn't anything that can actually fail.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
The loss of precision was teh problem, i'm attempting to use the code in (Strange effects with bitwise operators to solve this)
|
|
|
|
|
I simply needed to do this to write a UINT to a 1 byte buffer, so i could save this value!
|
|
|
|
|
Since an UINT it 4 bytes, it's impossible to cast it to a char (1 byte) without losing precision. Of course if the 24 highest bits (the 3 "leftmost" bytes) of the UINT are all zeroes, no information would be lost. The value may differ thought, since UINT is unsigned, and char is not; i.e. it's signed) Casting from char to UINT however should never give you any trouble.
Jason M wrote:
I simply needed to do this to write a UINT to a 1 byte buffer, so i could save this value!
Ok, you want to save this value, but why not save it in a 4 byte buffer, which is how much an UINT requires?
Sprudling
|
|
|
|
|
Just a quick note. When working with a datatype, you should never assume what size they are. Use sizeof(..) to get the storage space in bytes.
/moliate
|
|
|
|
|
I've tried to convert a UINT to char and back again, it doesnt work, how many bytes in one UINT and how many bits per byte?
|
|
|
|
|
UINT - A 16-bit (2 bytes) unsigned integer on Windows versions 3.0 and 3.1; a 32-bit (4 bytes) unsigned integer on Win32.
I vote pro drink
|
|
|
|
|
|
Ok, now I want to know what COM is!!
Or I just want to make it clear, my thought is that a COM -> OBJECT <- is a varible:
CAClass com; // COM object???
No, I don't think so...
What HOW do I make a COM object for example??
I don't realy know how it looks like! (
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Rickard Andersson wrote:
Or I just want to make it clear, my thought is that a COM -> OBJECT <- is a varible:
CAClass com; // COM object???
No, I don't think so...
VERY simplified:
<br />
class COMInterface<br />
{<br />
public:<br />
virtual method1 = 0;<br />
virtual method2 = 0;<br />
};<br />
<br />
class COMCoClass: public COMInterface<br />
{<br />
method1;<br />
method2;<br />
}<br />
<br />
int main(void)<br />
{<br />
...<br />
COMInterface* pInterface;<br />
...<br />
pInterface->method1;<br />
...<br />
}<br />
<br />
I vote pro drink
|
|
|
|
|
|
I have general question about COM developing in VB.
Does Visual Basic have something like ATL for COM developing(except ActiveX)?(I mean something like "simple object"in ATL)
VB doesn't have pointers ,so How does it implement interfaces,methods and another things in COM.
Are COMs that design in VB as strong as,as fast as or... COMs that in ATL have?
|
|
|
|
|
When you make a com object in something named VB, you not write the IDL. The interface is generated by the VB compiler...
In same mode is easy to write com objects in VB, but the problem is that you don't have the control like in ATL projects when you write the IDL file...
Best Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Everything in VB 4/5/6 is COM. If you create a new project as an ActiveX DLL or ActiveX EXE, you will have COM servers, and all you need to do is to fill in the methods you want. Everything else is done by the compiler.
However, COM servers created with VB depend on VB runtime, and they can never be lean and fast as ATL created.
I vote pro drink
|
|
|
|
|
Hi.
Is it easy to read from and write to the com port using C++? Is there a library for it?
Thanks,
Kuphryn
|
|
|
|
|
Try CreateFile or OpenFile API functions ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Okay. Thanks.
Felix posted a reply at Programmer's Heaven and mentioned functions:
inp();
and
outp();
http://www.programmersheaven.com/msgboard/read.asp?Board=3&MsgID=93124&Setting=A9999F0001
Those functions are from conio.h. What do you think about those functions?
Kuphryn
|
|
|
|
|
kuphryn wrote:
inp();
and
outp();
http://www.programmersheaven.com/msgboard/read.asp?Board=3&MsgID=93124&Setting=A9999F0001
Those functions are from conio.h. What do you think about those functions?
They are old and you are probably better of using a modern class-library or perhaps an Active-X component like GreenLeaf CommX. I am in no way connected to Green Leaf but I have successfully used thier products for 10 years on all OS:es from DOS, OS/2 to Windows 3.11/95/NT/2000. Their site is at http://www.gleaf.com/
--
Mattias Wahlberg
IDNet
|
|
|
|
|
Hi,
Unfortunly, thease functions can't works on Win NT !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|