Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2005

Tip: Looking for answers? Try searching our database.

Getting CreateFile handle in managed code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve N. - 21 Jun 2005 14:33 GMT
I'm having trouble getting a handle returned from the following code
within a managed class:

HANDLE m_hSerialComm = CreateFile("\\\\.\\COM1\0\0\0",
        GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING,
        FILE_FLAG_NO_BUFFERING, 0);

It works fine in non-managed code but I get a '{void}' returned when run
within managed code. I'm wondering if that's actually the problem or if
there is something else I'm missing... If it is the problem, then what's
the best solution?

Thanks
Steve
Tomas Restrepo \(MVP\) - 22 Jun 2005 01:24 GMT
Steve,
> I'm having trouble getting a handle returned from the following code
> within a managed class:
[quoted text clipped - 7 lines]
> there is something else I'm missing... If it is the problem, then what's
> the best solution?

There shouldn't be a problem. I believe what you're seeing is that when
working in the mixed mode debugger it has "issues" displaying the values of
certain things (like handle values, which are just void* in essence).

Signature

Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.