Click here to Skip to main content
15,907,687 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionAccessing a menu from a Console App ?? Pin
Fritzables14-Dec-06 11:21
Fritzables14-Dec-06 11:21 
AnswerRe: Accessing a menu from a Console App ?? Pin
User 58385214-Dec-06 11:48
User 58385214-Dec-06 11:48 
QuestionCalling a bridge from unmanaged dll Pin
Jose Viveiros14-Dec-06 7:13
Jose Viveiros14-Dec-06 7:13 
QuestionTabControl and Focus Pin
bsaksida14-Dec-06 2:49
bsaksida14-Dec-06 2:49 
AnswerRe: TabControl and Focus Pin
bsaksida14-Dec-06 8:25
bsaksida14-Dec-06 8:25 
QuestionRelease HWND and DC Pin
uusheikh13-Dec-06 22:30
uusheikh13-Dec-06 22:30 
AnswerRe: Release HWND and DC Pin
lafleon14-Dec-06 10:10
lafleon14-Dec-06 10:10 
AnswerRe: Release HWND and DC Pin
Mark Salsbery14-Dec-06 12:12
Mark Salsbery14-Dec-06 12:12 
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^)
GeneralRe: Release HWND and DC Pin
uusheikh14-Dec-06 21:05
uusheikh14-Dec-06 21:05 
Questionhow can i use DLL in managed code. Pin
Banks K13-Dec-06 21:15
Banks K13-Dec-06 21:15 
AnswerRe: how can i use DLL in managed code. Pin
lafleon14-Dec-06 10:14
lafleon14-Dec-06 10:14 
QuestionNewing a Arraylist Pin
fairose13-Dec-06 18:34
fairose13-Dec-06 18:34 
AnswerRe: Newing a Arraylist Pin
User 58385213-Dec-06 19:15
User 58385213-Dec-06 19:15 
GeneralRe: Newing a Arraylist Pin
fairose13-Dec-06 19:33
fairose13-Dec-06 19:33 
AnswerPosting Police [modified] Pin
toxcct14-Dec-06 1:41
toxcct14-Dec-06 1:41 
QuestionSendMessage Pin
abhiramsss13-Dec-06 11:02
abhiramsss13-Dec-06 11:02 
AnswerRe: SendMessage Pin
led mike13-Dec-06 11:08
led mike13-Dec-06 11:08 
QuestionRegarding parameter by reference in copy constructor Pin
Karismatic12-Dec-06 19:56
Karismatic12-Dec-06 19:56 
AnswerRe: Regarding parameter by reference in copy constructor Pin
George L. Jackson12-Dec-06 23:48
George L. Jackson12-Dec-06 23:48 
GeneralRe: Regarding parameter by reference in copy constructor Pin
prasad_som12-Dec-06 23:58
prasad_som12-Dec-06 23:58 
GeneralRe: Regarding parameter by reference in copy constructor Pin
prasad_som13-Dec-06 0:01
prasad_som13-Dec-06 0:01 
GeneralRe: Regarding parameter by reference in copy constructor Pin
George L. Jackson13-Dec-06 2:13
George L. Jackson13-Dec-06 2:13 
GeneralRe: Regarding parameter by reference in copy constructor Pin
prasad_som13-Dec-06 2:33
prasad_som13-Dec-06 2:33 
AnswerRe: Regarding parameter by reference in copy constructor Pin
Michael Dunn13-Dec-06 8:56
sitebuilderMichael Dunn13-Dec-06 8:56 
QuestionSend Keyboard Values ?? Pin
Fritzables12-Dec-06 16:55
Fritzables12-Dec-06 16:55 

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.