473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

a question about types

I am creating an unmanaged Diretcx 9 application but I
want to integrate it to my managed c++ application.

Here is the problem:
I dont want to use
m_hWnd = CreateWindow( _T("D3D Window"),m_strWindowTitle,
m_dwWindowStyle, CW_USEDEFAULT, (rc.right-rc.left),
(rc.bottom-rc.top), 0,LoadMenu( hInstance, MAKEINTRESOURCE
(IDR_MENU) ), hInstance, 0 );
to create my window.

I just use the windows Form designer.

but to create my device, I need a window handle of type
HWND.

how can I retrieve this type (HWND) from my form Form1
(this)?
this->Handle returns me an object of type System::IntPtr

How can I convert (if possible) IntPtr to HWND in
(managed) c++?
Nov 17 '05 #1
1 1077

"GAEL" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
I am creating an unmanaged Diretcx 9 application but I
want to integrate it to my managed c++ application.

Here is the problem:
I dont want to use
m_hWnd = CreateWindow( _T("D3D Window"),m_strWindowTitle,
m_dwWindowStyle, CW_USEDEFAULT, (rc.right-rc.left),
(rc.bottom-rc.top), 0,LoadMenu( hInstance, MAKEINTRESOURCE
(IDR_MENU) ), hInstance, 0 );
to create my window.

I just use the windows Form designer.

but to create my device, I need a window handle of type
HWND.

how can I retrieve this type (HWND) from my form Form1
(this)?
this->Handle returns me an object of type System::IntPtr

How can I convert (if possible) IntPtr to HWND in
(managed) c++?


The IntPtr returned should be equal to the HWND you want. IntPtr is a hold
all for pointers and handles because its size is determined by the system
you are executing on(4 bytes for 32bit, 8bytes for 64bit). Without testing,
HWND m_HWND = this->Handle; should work.
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Lash Rambo | last post by:
How does one go about programming in C++ without making assumptions about the size of types? Is it really possible? For instance, even the well-intentioned, portable C++ (and C) code I've seen...
111
by: JKop | last post by:
Okay here we go, I feel it's about time people conversed about the bullshit aspects of C++ (including the bullshit stuff brought forward from C). I'll begin with a few of my own grievances: 1)...
5
by: Zach | last post by:
When it is being said that, "value types are created on the stack or inline as part of an object". If a value type is created in an object, and that object is being called, the value type in that...
3
by: MIGUEL | last post by:
Hi all, I'm quite lost with how adding web references to a project creates proxy classes. I've developed a web service with two classes inside and that contains three references to three...
6
by: gangesmaster | last post by:
let's start with a question: ========== >>> class z(object): .... def __init__(self): .... self.blah=5 .... >>> class x(object): .... def __init__(self): .... ...
5
by: edware | last post by:
Hello, I have some questions about the size_t type. First, what do we know about size_t? From what I have read I believe that it is an unsigned integer, but not necessarily an int. Am I correct?...
68
by: James Dow Allen | last post by:
The gcc compiler treats malloc() specially! I have no particular question, but it might be fun to hear from anyone who knows about gcc's special behavior. Some may find this post interesting;...
90
by: John Salerno | last post by:
I'm a little confused. Why doesn't s evaluate to True in the first part, but it does in the second? Is the first statement something different? False print 'hi' hi Thanks.
75
by: Steven T. Hatton | last post by:
No, this is not a troll, and I am not promoting Java, C-flat, D, APL, Bash, Mathematica, SML, or LISP. A college teacher recently posted to this newsgroup regarding her observation that there has...
4
by: Jess | last post by:
Hello, I tried several books to find out the details of object initialization. Unfortunately, I'm still confused by two specific concepts, namely default-initialization and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.