|
I woud like to know how to focus on the specific tab?
Thanks in advance
|
|
|
|
|
Already found it:
tabControl->SelectedTab = tabPage;
|
|
|
|
|
1. I have a mixed mode program (managed + unmanaged). Some where in the program i do this to get the HWND of a picture box which is passed to an unmanaged function.
HWND hwnd = (HWND) pbSurfaceLeft->Handle.ToPointer();
Do i have to release the HWND when i'm done using it? If so, how to do in C++/CLI?
2. This is not a C++/CLI question, but it is related anyway, so i'll post it here.
Imagine i have a function
void Draw (CDC *pDC);
and i call it this way
Draw(this->GetDC());
Do i have to call ReleaseDC after that? If so how? I didnt save the pointer of GetDC(), as it was only passed directly.
3. When compiling with warning level 4, all unreferenced formal parameters are warned. How can i avoid that by adding code rather than using #pragma disable?
eg.
System::Void pbSurfaceRight_MouseLeave(System::Object^ sender, System::EventArgs^ e)<br />
Thanks
|
|
|
|
|
Hi,
Looks like don’t create those window and device context. Don’t delete them.
Regrads
|
|
|
|
|
uus831 wrote: 1. I have a mixed mode program
(managed + unmanaged). Some where in the program i do this to get the HWND of a picture box which
is passed to an unmanaged function.
HWND hwnd = (HWND) pbSurfaceLeft->Handle.ToPointer();
Do i have to release the HWND when i'm done using it? If so, how to do in C++/CLI?
Probably not. The HWND is managed by the pbSurfaceLeft object.
uus831 wrote: 2. This is not a C++/CLI question, but
it is related anyway, so i'll post it here.
Imagine i have a function
void Draw (CDC *pDC);
and i call it this way
Draw(this->GetDC());
Do i have to call ReleaseDC after that? If so how? I didnt save the pointer of GetDC(), as it was
only passed directly.
Yes you do have to call ReleaseDC, since the CDC destructor uses ::DeleteDC() which is not
correct for HDCs obtained with GetDC:
CDC *pDC = GetDC();
Draw(pDC);
ReleaseDC(pDC);
uus831 wrote: 3. When compiling with warning level
4, all unreferenced formal parameters are warned. How can i avoid that by adding code rather than
using #pragma disable?
Here's one way:
System::Void pbSurfaceRight_MouseLeave(System::Object^ sender, System::EventArgs^ /*e*/)
and another
System::Void pbSurfaceRight_MouseLeave(System::Object^ sender, System::EventArgs^)
|
|
|
|
|
Thanks, that helped!
|
|
|
|
|
Hi all,
i have a DLL named as "AxInterop.ECLActiveX.dll" but i dont know is it "activex control" or "simple com DLL".
I have to use this DLL in my application which is console base application in managed code.
this DLL export some function like "compreesFile" etc.
can anybody tell me how can call function from that DLL.
please reply me.
thanks
bankey
|
|
|
|
|
Hi,
Just read 'Interop Marshaling' on MSDN.
Regards
|
|
|
|
|
How do i gcnew a arraylist to array? I have initialised the variables under the ref form function and i need to create a method to call and new the variable to array and display them in a treeview control. How Do I Need To Do???PLS HELP!!!
Sample coding is below of what i have done so far. Basically i need to drag drop a icon to panel and once it displays there, the trewview control will show. In this Case i haf 1 base Station which is the parent and many subscriber station which is the child. For 1 base station there will be many Subscriber station. So i need to pass in the string variable.
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
baseStationNode = gcnew ArrayList();
baseStationNode->Add(baseStationNode);
subscriberNode = gcnew ArrayList();
subscriberNode->Add(subscriberNode);
//
//TODO: Add the constructor code here
//
}
protected:
private: ArrayList^ subscriberNode;
private: ArrayList^ baseStationNode;
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
//TreeNode^ baseNode;
//array<treenode^>^ subNodeArr;
//static int count=0;
#pragma endregion
private: System::Void add_baseNode()
{
baseStationNode = gcnew array();
// baseNode = gcnew TreeNode(String::Format("Base Station"));
// treeView1->Nodes->Add(baseNode);
}
Pls Help Me check and gif me a sample codes of where i need to add in and how and y. THANKS A LOT!
|
|
|
|
|
I dont really understand what you are attempting to do but your code is a bit all over the show
fairose wrote: baseStationNode = gcnew ArrayList();
baseStationNode->Add(baseStationNode);
What is this supposed to be doing?
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
This part is that i am trying to initialise a variable call baseStationNode into the arraylist and newing it.
private: ArrayList^ baseStationNode;
this is where i set the the variable to be a arraylist.
|
|
|
|
|
pleaaaaaase, Read the posting guidelines[^], then edit your message, and place your code into <pre> tags. this will format your post regarding Codeproject's style sheet.
thanks.
|
|
|
|
|
To SendMessage how to send a string as argument
and how to recieve and display that string
lets say in a edit box i have some text ABCD , i want to capture this text to a CString and pass this CString to Sendmessage as Wparam parameter to other remote process(iam using sockets for remote connevtion). and at remote Application i will capture this wparam and display the message
how to do this using send message.
Thanks in advance
abhi
|
|
|
|
|
abhiramsss wrote: and pass this CString to Sendmessage as Wparam parameter to other remote process(iam using sockets for remote connevtion).
umm you don't use SendMessage to communicate to another process using a socket.
led mike
|
|
|
|
|
I am confused that why we have to pass a reference of same class type into a copy constructor? I searched a lot but i am not able to find out the exact answer.So,plz if anybody can forward me the relevant answer of this question then plz forward it as soon as possible.Please specify the reason.
thanks..
|
|
|
|
|
When you are copying objects, you need a source and a destination. The destination or "new" object must be able to access the data of the source object to copy its data and perform any necessary resource allocation.
ref class Foo
{
int value;
String ^string;
public:
Foo() {}
Foo(const Foo %f)
{
value = f.value;
string = f.string;
}
...
};
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
He is interested in knowing why need of passing parameter as reference.
|
|
|
|
|
|
Thanks!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
|
Because that's just how the copy constructor works. The parameter has to be a reference. If it weren't a reference, how could you make a copy of the input object? (You don't have a copy constructor yet, you're writing it!)
|
|
|
|
|
I am creating a console app that starts NOTEPAD.EXE but then needs to emulate the user accessing the menu.
I have started the process by using
Process::Start("NOTEPAD.EXE");
Now I need to simulate a user pressing 'Alt F' to access the file menu - how do I achieve this ??
Pete
|
|
|
|
|
Off the top of my head....
Use the non static version of Process::Start() so you have a Process object
Call Process.MainWindowHandle() to get a handle to the window
Then use Win32 functions or MFC to send messages to the window using the handle
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
Thanks Josh,
See how we go.....
Pete
|
|
|
|
|
I woud like to have an example, how to encryipt String into md5 hash.
Coud md5 encryption produce same hash as md5 from php?
Thanks in advance
|
|
|
|