Click here to Skip to main content
16,007,885 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Read file .txt Pin
Mark Salsbery19-Jun-07 9:32
Mark Salsbery19-Jun-07 9:32 
QuestionGetProcAddress() Pin
sujithkumarsl18-Jun-07 20:03
sujithkumarsl18-Jun-07 20:03 
AnswerRe: GetProcAddress() Pin
Giorgi Dalakishvili19-Jun-07 7:02
mentorGiorgi Dalakishvili19-Jun-07 7:02 
QuestionNeed help!! Pin
faradgi18-Jun-07 18:36
faradgi18-Jun-07 18:36 
AnswerRe: Need help!! Pin
Christian Graus20-Jun-07 16:39
protectorChristian Graus20-Jun-07 16:39 
QuestionsendASPI32Command returns SS_ASPI_IS_BUSY Pin
aks.18-Jun-07 1:54
aks.18-Jun-07 1:54 
AnswerRe: sendASPI32Command returns SS_ASPI_IS_BUSY Pin
Christian Graus18-Jun-07 12:27
protectorChristian Graus18-Jun-07 12:27 
QuestionHandling WinAPI windows (by HWND) in Managed C++ Pin
matmus16-Jun-07 4:19
matmus16-Jun-07 4:19 
I have a window handle (HWND) obtained from a DLL (the lib creates its own dialog form and returns handle to it - /library is written using MFC - code is as follows/).
What I need to do is to 'dock' this window somehow in a TabControl of an application written in Managed C++, VS 2005 (preferrably as a new Tab).

So basically I need sth like conversion from HWND to a usable object in .NET (Control^ or TabPage^ perhaps?). What I tried to do, is use of System::Windows::Forms::Control::FromHandle() function with my Handle casted to IntPtr, but it didn't work (my guesses: it only handles controls already created using .NET, not 'simple' WinAPI windows). It's also possible, that I've missed something obvious - I'm a complete newbie to all this .NET stuff.

My 'main' application used to also be written using MFC, so I could convert this handle back to CWnd* (using FromHandle() )and act on it as on a 'normal' MFC window (in eg.: call ShowWindow(SW_SHOW) or SetParent() for it).
How to do such a thing in .NET (meaning: to get a window from HWND, place it as a child of a Windows::Forms container (like TabControl or sth else), move/resize it to client's dimensions, and then show it to the user)?

A sketch of code that creates the window:
HWND LoadDialog() {<br />
    CMyDialog* pNewDialog = new CMyDialog(); <br />
         /*MyDialog inherits from CDialog*/<br />
    pNewDialog->Create (MAKEINTRESOURCE(IDD_RESOURCE), NULL))<br />
         /*loads the window layout from DLL's resources*/<br />
    return pNewDialog->GetSafeHwnd();<br />
}


PS. I've posted a copy of this post to codeguru Blush | :O
AnswerRe: Handling WinAPI windows (by HWND) in Managed C++ Pin
Mark Salsbery16-Jun-07 7:31
Mark Salsbery16-Jun-07 7:31 
GeneralRe: Handling WinAPI windows (by HWND) in Managed C++ Pin
matmus16-Jun-07 19:15
matmus16-Jun-07 19:15 
GeneralRe: Handling WinAPI windows (by HWND) in Managed C++ Pin
Mark Salsbery17-Jun-07 8:35
Mark Salsbery17-Jun-07 8:35 
QuestionLocalizing some extern/global vriables? Pin
granshah @ eVisionISF16-Jun-07 1:47
granshah @ eVisionISF16-Jun-07 1:47 
Questionhow can i get the ref of multi dimension array Pin
Ahmed Ismail Mohamed15-Jun-07 22:46
Ahmed Ismail Mohamed15-Jun-07 22:46 
QuestionManaged C++ with No touch Deployment Pin
jeongmo14-Jun-07 11:26
jeongmo14-Jun-07 11:26 
QuestionDoes a program have more than 1 process in task manager? Pin
DotNetUser5414-Jun-07 8:22
DotNetUser5414-Jun-07 8:22 
AnswerRe: Does a program have more than 1 process in task manager? Pin
Mark Salsbery14-Jun-07 9:20
Mark Salsbery14-Jun-07 9:20 
GeneralRe: Does a program have more than 1 process in task manager? Pin
led mike14-Jun-07 10:50
led mike14-Jun-07 10:50 
GeneralRe: Does a program have more than 1 process in task manager? Pin
Mark Salsbery14-Jun-07 11:26
Mark Salsbery14-Jun-07 11:26 
QuestionWhy doesn't this work? Pin
myhanguk14-Jun-07 2:16
myhanguk14-Jun-07 2:16 
AnswerRe: Why doesn't this work? Pin
prasad_som14-Jun-07 3:01
prasad_som14-Jun-07 3:01 
AnswerRe: Why doesn't this work? Pin
Mark Salsbery14-Jun-07 9:28
Mark Salsbery14-Jun-07 9:28 
QuestionRe: Why doesn't this work? Pin
Ahmed Ismail Mohamed15-Jun-07 22:50
Ahmed Ismail Mohamed15-Jun-07 22:50 
QuestionSerialize with BinaryFormatter Pin
hansipet14-Jun-07 0:56
hansipet14-Jun-07 0:56 
QuestionBooks for Managed C++ Pin
vibindia13-Jun-07 16:58
vibindia13-Jun-07 16:58 
AnswerRe: Books for Managed C++ Pin
Christian Graus14-Jun-07 12:46
protectorChristian Graus14-Jun-07 12:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.