|
In a nutshell, the function you're calling is allocating a CTreeCtrl object and wants to pass you back a reference to it. However, you have your own CTreeCtrl object and want to - in effect - have the returned object copied into yours. You can't do that because the CTreeCtrl class doesn't define a copy constructor.
You have three choices.
1) Derive your own CTreeCtrl class and implement a copy constructor
2) Change the BeginParseDocument function
3) Change your application to accept a returned reference
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
(Steven Hicks)n+1 wrote:
C:\Documents and Settings\Steven Hicks\My Documents\Visual Studio Projects\DueLastWeek\SlidingOpen.cpp(108) : error C2582: 'CTreeCtrl' : 'operator =' function is unavailable
Tom's right. Your function is returning a CTreeCtrl& - you need to return a CTreeCtrl*
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Hi,
In my SDI application I want to use a splitter window and on the left side I want to use a Tree View and on the right side I want to have Form View and for different selection on the items of the Tree View, I want to show different Forms on the right view. How can I achieve this? Can anybody help me out with pointers on the above?
Thanks,
Binayak
|
|
|
|
|
I have the following code concerning loading GDI+ Bitmap (PNG actually) of length len from buffer buf :
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, len);<br />
void *buf = hGlobal ? GlobalLock(hGlobal) : NULL;<br />
if(buf) CopyMemory(buf, CBaseItem::BFFile->Buf, len);<br />
else if(hGlobal) GlobalFree(hGlobal);<br />
<br />
IStream* stream = NULL;<br />
if(buf && CreateStreamOnHGlobal(buf, TRUE, &stream) == S_OK)<br />
{<br />
image = Bitmap::FromStream(stream);<br />
stream->Release();<br />
}
It works perfectly on XP, but it fails under Windows Millenium: image->LastResult == InvalidParameter . The data in a buffer seems the same in both cases.
Why is it so?
Regards,
BB
|
|
|
|
|
How do you extract an image from a wmv file? Any samples or possible ideas, i have looked at the windows media format sdk, but its not too easy to understand
Any help would be a real life saver!
|
|
|
|
|
the function OleLoadPicture could do what you're searching for, coupled with a IPicture interface. Have a look to the sample 218972[^] from MSDN.
HTH,
K.
|
|
|
|
|
Is there any way that I using code can add and remove users on Windows 2000 Server.
|
|
|
|
|
Have a look at the Active Directory doc on MSDN, specifically the samples for creating a user [^].
Brad
|
|
|
|
|
NetUserAdd worked for me.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Hi, need help!!
Does anybody know how to grab the data stream that goes to
the graphics card from windows and then on to a projector for example, or even how this works????
I presume that the data stream is going to come from the
windows desktop through win32.
Any ideas or links greatly appreciated!!
Cheers,
/Shane.
|
|
|
|
|
This can not be done easily. Use a projector that has a vga input. If you are using a laptop it should have a vga connector and you should be able to use both on, or either on. Their should be a keyboard command for that.
John
|
|
|
|
|
Hi,
Is there a method that will convert an float to a hex number?
Thanks.
|
|
|
|
|
A "hex" number is how it is represented, not how it is stored (i.e., its type). All numbers have a base-16 representation, be they floating-point or integer. For example, if I had a number (12345) and I wanted to see its base-16 representation, I'd use:
int num = 12345;
char szNum[16];
sprintf(szNum, "%#x", num); szNum now contains "0x3039." No conversion was done, it's just shown in a different base.
See if these two MSDN articles help you along any:
Q42980
Q125056
|
|
|
|
|
Thanks for the help.
Where can I find those articles, on the msdn.microsoft site?
Just to clarify: I am sending information from my program to someone else via the internet. I was told that the information has to be sent in hex format. So are you saying i can just send a float number?
Thanks for all your help
|
|
|
|
|
Jay Hova wrote:
Where can I find those articles, on the msdn.microsoft site?
Yes.
Jay Hova wrote:
Just to clarify: I am sending information from my program to someone else via the internet. I was told that the information has to be sent in hex format. So are you saying i can just send a float number?
See this thread.
|
|
|
|
|
Great... While I'm off, straining my tiny brain to come up with something that might just pass for helpful, you pop in with an easy solution. Sheesh!
"Welcome to Arizona! Drive Nice - We're Armed..." - Proposed Sign at CA/AZ Border
|
|
|
|
|
I know the feeling.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=592740#xx592740xx
|
|
|
|
|
I'm not sure what they're trying to say - "Hex format"? It could many several things.
The IEEE format for representing a floating point number is
S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF
0 1 8 9 31
where S = the sign bit, EEEEEEEE = the exponent, and FFF...F = the fractional mantissa. In this format each bit has meaning, and on the receiving end the consumer has to expect and recognize this format. When you send it in hex, you're just sending bits in groups of 4, or
SEEE EEEE EFFF FFFF FFFF FFFF FFFF FFFF
Hex0 Hex1 Hex2 Hex3 Hex4 Hex5 Hex6 Hex7
It's up to the receiver to combine the 8 hex characters' bit pattern into a single 32-bit value and correctly interpret it as a floating point value.
On the other hand, if your application requires you to send text data only, using the ascii characters that represent the hex characters that are equivalent to your floating point value, you have a real challenge. First you'll have to convert the float into a collection of 4-bit chunks, then determine the hex character for each chunk, then convert each hex character to text. I wouldn't know how to begin that, I'm afraid, though almost everyone here is smarter than I about such things and may be able to guide you.
Hopefully you're dealing with the first case...
"Welcome to Arizona! Drive Nice - We're Armed..." - Proposed Sign at CA/AZ Border
|
|
|
|
|
Anyone know how to use the ip control?? Maybe get the current machine's ip as an example... I would appreciate it.
<marquee>Universal Project
|
|
|
|
|
Getting a machine's IP address and using the IP control are mutually exclusive things.
gethostname();<br />
gethostbyname();<br />
CIPAddressCtrl::SetAddress();
are what you need to look at.
|
|
|
|
|
Let's pretend that you are talking to somebody that does not know anything about the IP Control. Examples are really nice things you know.
<marquee>Universal Project
|
|
|
|
|
And they are plentiful!
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=cipaddressctrl&btnG=Google+Search
|
|
|
|
|
1) DWORD addr;
((CIPAddressCtrl*)GetDlgItem(IDC_IPIDDRESS1))->GetAddress(addr);
2) BYTE b1,b2,b3,b4;
((CIPAddressCtrl*)GetDlgItem(IDC_IPIDDRESS1))->GetAddress(b1,b2,b3,b4);
If address is 212.176.73.161, b1=212, b2=176, b3=73, b4=161.
yiy
|
|
|
|
|
I have a dialog application which hosts several sub dialogs. I need to send a message from one of the sub dialogs which can be received by all of the other sub dialogs. What's the best way to do this in MFC?
Todd Smith
|
|
|
|
|
Are the dialogs modeless?
|
|
|
|