Solved

How to get the application instance in .net cf or wince

Posted on 2004-09-27
8
413 Views
Last Modified: 2013-11-18
I need to pass in the application instance to a p/invoke function call using c# and .net compact framework.  Calling a p/invoke function call to wince would be fine as well.

Thanks,
Craig
0
Comment
Question by:cdoggett
  • 6
  • 2
8 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 12163706
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12163715
0
 

Author Comment

by:cdoggett
ID: 12164236
Thanks, I am very familar with platform invoke and that article from Microsoft is wonderful as I have used pieces of it in the past.  However, it does not address how to get the application instance (hinstance) that I saw.

Craig
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 48

Expert Comment

by:Mikal613
ID: 12164689
"Calling a p/invoke function call to wince would be fine as well."
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12164693
"(hinstance) that I saw" where did you see it?
0
 

Author Comment

by:cdoggett
ID: 12171817
In this function call that works under .Net, but not under .Net CF.  I get an Unsupported Function exception.    The code is as follows:

IntPtr appInstance = System.Runtime.InteropServices.Marshal.GetHINSTANCE( module );

The return value is the HINSTANCE of the module or -1 if it does not have an instance.

An equivalent WinCE solution would work as well.



0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12172272
Thanks
0
 
LVL 48

Accepted Solution

by:
Mikal613 earned 250 total points
ID: 12172314
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
Progress means simplifying, not complicating. Bruno Munari Preface How to detect the name of the internal storage or an SD-card on Windows Mobile device from the desktop application? I got this question, when I was working on a PC applicati…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question