|
Hi all,
I need to convert a System::Drawing::Rectangle __gc * to System::Drawing::Rectangle. Is this possible and how would I do it?
Thanks in advance.
The problem is I'm trying to set the bounds of a form by passing it a rectangle. The rectangle, however, is a managed rectangle but form->Bounds takes an unmanaged rectangle.
|
|
|
|
|
Well, I doubt very much that an operator exists, but surely it's just a case of creating a new Rectangle using the data in the old one ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How do I create an unmanaged Rectangle in a managed class? I'm trying,
Rectangle r2 = __nogc new Rectangle ( 0, 0, 0, 0 );
but this just gives me an error.
|
|
|
|
|
I'm sorry, that I don't know. But it's definately the case that you need to create one, there won't be a conversion.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Try making an unmanaged proxy function such as:
void SetBounds(int x, int y, int w, int h) {
Form->bounds = New Rectangle(x, y, w, h);
}
And call it from your managed function.
It's been a while since I used C++, but you get the idea.
|
|
|
|
|
Thanks guys.
Sorted the problem by passing each element individually into the bounds property like so,
<br />
System::Drawing::Rectangle* r1;
form1->Bounds = Rectangle ( r1->X, r1->Y, r1->Width, r1->Height );<br />
or somethng along those lines. Seems to work.
|
|
|
|
|
How?
I try do this:
case WM_NOTIFY:
switch(LOWORD(wParam))
{
case IDC_LIST:
pThis->EditLabel(hWnd, lParam);
}
break;
void IMyIEExtention::EditLabel(HWND hWnd, LPARAM lParam)
{
TVITEM tvi;
tvi.mask = TVIF_TEXT;
tvi.cchTextMax=256;
memset(&tvi,0,sizeof(tvi));
LRESULT lr;
// tvi.cchTextMax = sizeof(tvi.pszText)/sizeof(tvi.pszText[0]);
if(((LPNMHDR)lParam)->code == TVN_BEGINLABELEDIT)
{
// MessageBox(NULL, "tv", NULL, MB_OKCANCEL);
hEdit=TreeView_GetEditControl(m_hList);
}
if(((LPNMHDR)lParam)->code == TVN_ENDLABELEDIT)
{
char Text[256]="";
tvi.hItem=TreeView_GetSelection(m_hList);
SendDlgItemMessage(hWnd,IDC_LIST,TVM_GETITEM,0,(WPARAM)&tvi);
GetWindowText(hEdit, Text, sizeof(Text));
tvi.pszText=Text;
lr = SendDlgItemMessage(hWnd,IDC_LIST,TVM_SETITEM,0,(WPARAM)&tvi);
}
}
This code doesn't work. Why?
|
|
|
|
|
Hello,
i need to insert a .NET Form into an MFC application using Visual Studio 2003, is it possible in some way? I've found some articles about doing it with Visual Studio 2005 but nothing more. Is possible is use the form as ActiveX control or what?
Thank you,
Gianmaria
|
|
|
|
|
|
Thank you very much, i'll try the source code provided
|
|
|
|
|
Hi!
How can i code to open a web page in a new IE windows instead of in the same IE windows like Response.Redirect? And i want the just opened web page get the authentication of the web page opening it (so doesn't need to login again)
Thanks!
|
|
|
|
|
Launch a new process (in .NET, that's System.Diagnostics.Process). The Windows Shell understands the IExplore command, therefore, to launch a new IE instance:
iexplore www.google.com
Here you've specified the iexplore (IE) process to launch with the argument www.google.com, making the new IE instance navigate to google. Is this what you wanted?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Yes, it is But if we open a web page this way, does it need to login again if it need to authenticate ? Because i need the just opened web page get the authentication of the web page opening it
Thanks your reply
|
|
|
|
|
I need to get buddy lists from each of AOL Instant Messenger, Yahoo Messenger, and MSN Messenger and be able to send them a one line Instant message.
Any ideas on how to do this?
|
|
|
|
|
Each messenger will be different; you may need to use proprietary protocols to interoperate with each. Maybe the GAIM[^] project will help you get started?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Hi all,
quick question. I've built a small project and I want to add a splash screen to my application. Does .net provide any splash screen components to make life easier or do I have to write from scratch?
Thanks in adavnce.
Rich
|
|
|
|
|
A splash screen is just a form without the title bar (Form->BorderStyle = FormBorderStyle::None), basically. Roll your own, or search CP for an existing.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Hello All,
I have a assignment something like this
LPTHREAD_START_ROUTINE a = ThreadProc;
Where ThreadProc is the thread function
After the above assignment a and ThreaProc shows different pointer value. Which is understandable.
My question is how do I get the ThreadProc pointer value back from a. How should my variable declaration look like
i.e if ThreadProc shows 0x00401028 in the watch window
and a shows 0x00401c90
then how do I obtain back 0x00401028 from a.
Rajdeep
|
|
|
|
|
Ok. So I'm working on a web service client in unmanaged C++ which is derived from CSoapSocketClientT.
I know that when creating a web service in .Net(C#,vb,c++) one have to use (through CookieContainer property) CookieContainer class to maintain session between requestes to the server. Is there something similar for unmananged C++ web service client? Or is generated (at "add web reference.." time) code's doing it somehow magicaly on it's own?
Please help!
|
|
|
|
|
How would I do this? Can some one direct me to a good tutorial. For what I'm trying to do now I really only need to use *.txt files, but it would be good to know how to use others as well.
|
|
|
|
|
|
Only Visual C++ .NET 2003 is affected by this problem so far.
Problem:
I currently have vc++ 6.0, vc++.net 2003 and vc++ 2005 beta2 (i also got beta1). I recently having some wied error with vc++ 2005 giving out error and error about each time I was moving the mouse. I decided to try to reinstall it to fix it (it didn't). An another problem popped up just after I reinstalled my vc++ 2005 with my vc++.net 2003. When I started it an open one of my project, I was having now that error that was keeping popping :
Compiling...
Form1.cpp
Compiling managed resources...
error: Entrée ResX non valide.
error: Specific exception: TargetInvocationException Message: Entrée ResX non valide. ---> TargetInvocationException: Une exception a été levée par la cible d'un appel. ---> InvalidOperationException: Impossible de charger ImageList.
2 error(s).
Test4 : error PRJ0002 : error result returned from 'resgen.exe'. My windows xp is in french, it's why a part of the error is in french.
It pretty ennuing when you need to build your project and that your project is using that feature. The problem is actually in cause by some wierd problem when the compiler parse your image data in the resx file. Some syncronisation problem happen. I tried many thing like reinstalling vc++.net 2003->test failed, reinstalling vc++2005->test failed again.
Solution:
Install VC++ 2005 Express Edition Beta 2. Create a similar project. Put in the form a imagelist and bring all your picture in. Save that project somewhere. Open the file Form1.resx (Form1 is name that your given to the form) with notepad. Browse down to the location where the imagelist is. It should look like that :
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA8
BwAAAk1TRnQBSQFMAgEBDQEAAQ4BAAEEAQABEAEAARABAAT/AQUBAAj/AUIBTQF2BwABdgMAASgDAAFA
AwABQAMAAQEBAAEEBgABCBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQADgAMAAf8CAAH/
AwAC/wEAAf8DAAH/AQAB/wEAAv8CAAP/QwABDwL/AfAcAAEPAf8BDwHwHAABDwH/AQAB8BoAAQgBiAEP
Af8cAAEIAf8BDwH/AQsBgBoAAQgB9wEPAf8BCwFwGgABCAH/AwABuBoAAQgB9wF3AfgBAAG3GgABCAL/
AfgBAAELAYAZAAEIA4gBAAELIAABEbkAAQgGiAGAGAABCAb/AYAOAALgAQ8E/wHwAgABCAb/AYAJAAGQ
AwACDgEAAQ8BAAHwAgAB8AIAAQgB+AKIAY8BiAGPAYAIAAEJAgACIAMAAQ8D/wGPAfACAAEIAu4E/wGA
CQABkAICBAABDwEAAf8B8AFwAfACAAEIAeABDgOIAY8BgAgAAQkHAAEPAQcBDwIHAQABBAFAAQgE7gHv
Af8BgBAAAQ8B8ANwAXcBBAFAAQgB+AGIAeABAAHoAY8BgBIAAwcBdwF0AUABCAL/Au4B7wH/AYALAAEL
AgABCQQAAXACdwF0AUABCAb/AYAMAAGwAQABkAQAAQcCdwEEAUABBAZEAUALAAELAgABCQcAAQQBQAEE
BkQBQAwAAbABAAGQqwABCwYAAQgBeAGIAQACBRQAAbAJAAFdAQUBUAkAAZABwAEgAgABCwQAAbsEAAEI
AngBgAEFAt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8wHnAfYBqwEA
AQEBgAEBAfMB5wH4AXEB+AEBAYABAQHzAecB/AEhAfwBAQGAAQEB8wHnAfwBIQH+AQkBgAEBAfkBzwH+
ASMH/wF3Ff8B9wT/AfMC/wHjBP8B8QH/AeABwQL/AYAB8QH4Av8BgAL/AYAB8QH4AX8BgQEAAf8BwQGA
AeMB/AE/Af8BAAHHAYgBgAHjAfgBHwHTAQABgAEcAYABxwH4AR8B/wEBAaABPgGAAccB/AE/Af8BgwHP
AZwBgAGPAfwBHwH/AccB/wGIAYABjwH+AQ8B/wHvAf8BwQGIAR8B/gEPBP8BiAEfGf8B7wf/AccH/wGD
AcABHwL/AYAC/wHBAcABDwHgAQ8BAAF/Af8BAwHAAQcBwAEHAQABfwH/AXcBwAEDAcABBwEAAX8B/wF/
AcABAQHAAQcBAAEDAf8BdwHAAQEBwAEHAQABAQHvAWMBwAEBAcABBwGAAQEBxwFBAeABAQHAAQcB/AEB
AYABAAHwAQEBwAEHAfwCAQHxAfgBAQHgAQ8B/AEBAYAB+wH8AQEC/wH+AQMBwQf/AeMH/wH3B/8L
</value>
</data>
Copy it and go in your project in which one you have problem with the imagelist and replace the current code. Go build your project and it should work.
This is only a temp solution and you should try to completly reinstall your operating system and your vc++.net 2003.
I hope that it will be usefull to someone.
|
|
|
|
|
Hi,
I'm using Visual C++ and is trying to generate different icons between release and debug executables. How should I do that?
Thanks,
vandz
|
|
|
|
|
you can use #if macro and check whether debug, then load the debug icon else release icon.
|
|
|
|
|
Thanks for the info. What should I put in my code for the #if macro to check whether it is debug?
Thanks.
|
|
|
|