Feed
Google+
Contact
XING
LinkedIn
Twitter
ICQ
meebo.com

C - 64 bit or 32 bit OS?

by Roland Schumacher alias GENiALi 23. September 2009 -- 191 words  -- 1 mal gelesen

If that is to be determined it is difficult. I had to investigate a problem that appears when working with the VSTO under Excel in a 64 bit OS. Certain operations cause the following error message:

Old format or invalid type library. (Exception from HRESULT: 0 x 80028018 (TYPE_E_INVDATAREAD))

Remedy creates article KB320369. The error is obviously led back to a bug in the VSTO.

I wanted to use the hack but not including the 32 bit OS. But for this I need some as determine whether the code under a 64 bit or 32 bit OS is running. The .NET Framework seems offer because no method to resolve this simply. There are some interesting solutions for the problem to find on the Internet.

I have now implemented following that works on Vista 64 bit and Windows 7 32 bit.

Forget //Nicht 
 using System.Runtime.InteropServices; 


[DllImport("Kernel32.dll")] 
private static extern uint GetSystemWow64Directory (StringBuilder lpBuffer, uint uSize); 
internal static byte GetOSBitness() 
 {
     StringBuilder lpBuffer = new StringBuilder(260); 
    }uint uSize = GetSystemWow64Directory (lpBuffer, 260); 
    If (uSize > 0) return 1; {//64-bit 
     return 0; //32-bit 
}

Found--HOWTO: detect process bitness

This solution works only on Windows XP (MSDN).

kick it on dotnet-kicks.de

Tags:

Kommentare sind geschlossen

Statistik

Gesamte Posts: 1025
Dieses Jahr: 7
Diesen Monat: 1
Diese Woche: 0
Kommentare: 929
Total Bewertungen: 91
Ø Bewertung: 4,42
Meisten Kommentare
Google+ ... (28)
Beste Ø Bewertung
Tastaturlayout von Visual Stud ... (5)
Meiste Bewertungen
Windows 7 und die ersten Erfah ... (5)

Buttons

Stop Spam Harvesters, Join Project Honey Pot Benutzerprofil von GENiALi connection speed test network connection Bloggeramt.de Slug.ch Blog Verzeichnis und Blog Webkatalog Schumacher Roland Seitwert Valid XHTML 1.0 Transitional

writing