Click here to Skip to main content
15,895,370 members
Home / Discussions / C#
   

C#

 
Questionhow to populate window's directory or explorer in the ListView Pin
tirumal123128-Dec-06 16:38
tirumal123128-Dec-06 16:38 
AnswerRe: how to populate window's directory or explorer in the ListView Pin
Eric Georgiades29-Dec-06 9:22
Eric Georgiades29-Dec-06 9:22 
Questionhow to pass parameter from a url Pin
Gallo_Teo28-Dec-06 16:34
Gallo_Teo28-Dec-06 16:34 
AnswerRe: how to pass parameter from a url Pin
Not Active28-Dec-06 17:25
mentorNot Active28-Dec-06 17:25 
GeneralRe: how to pass parameter from a url Pin
Gallo_Teo28-Dec-06 17:31
Gallo_Teo28-Dec-06 17:31 
GeneralRe: how to pass parameter from a url Pin
Not Active28-Dec-06 18:08
mentorNot Active28-Dec-06 18:08 
GeneralRe: how to pass parameter from a url Pin
Gallo_Teo29-Dec-06 16:50
Gallo_Teo29-Dec-06 16:50 
QuestionI have some questions in C# Pin
Flysocket28-Dec-06 15:33
Flysocket28-Dec-06 15:33 
using System;
using System.Text;
using System.Runtime.InteropServices;

namespace AEXMLAdapterTester
{
internal sealed class NativeMethods
{
private NativeMethods() {}

[DllImport("AEXMLAdapter.dll", EntryPoint="GetAllSettings", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern uint GetAllSettings(StringBuilder lpBuffer, ref uint lpnSize);

[DllImport("AEXMLAdapter.dll", EntryPoint= "SetAllSettings", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern uint SetAllSettings(string lpBuffer);

[DllImport("AEXMLAdapter.dll", EntryPoint= "ReloadSettings", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern uint ReloadSettings();
};

///
/// Summary description for XmlAdapterInterop.
///

///
internal sealed class XmlAdapterInterop
{
private XmlAdapterInterop() {}

public static string GetAllSettings()
{
uint retVal;
StringBuilder buffer = null;
uint size = 0;

retVal = NativeMethods.GetAllSettings(null, ref size);
if (retVal == 122)
{
buffer = new StringBuilder((int)size);
retVal = NativeMethods.GetAllSettings(buffer, ref size);
}

if (retVal != 0)
throw new ApplicationException("Interop Error calling GetAllSettings");

return buffer.ToString();
}

public static void SetAllSettings(string buffer)
{
uint retVal;
retVal = NativeMethods.SetAllSettings(buffer);
if (retVal != 0)
throw new ApplicationException("Interop Error calling SetAllSettings - retVal = " + retVal);
}

public static void ReloadSettings()
{
uint retVal;
retVal = NativeMethods.ReloadSettings();
if (retVal != 0)
throw new ApplicationException("Interop Error calling SetNothing - retVal = " + retVal);
}
}
}

These code running correctly in Windows 2003 server 32Bit
but when use in Windows Server 64Bit when i invoke XmlAdapterInterop.GetAllSettings() an exception occured "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

Any one can help me, i will thank you a lot



I want to make some friends here

AnswerRe: I have some questions in C# Pin
Luc Pattyn28-Dec-06 15:51
sitebuilderLuc Pattyn28-Dec-06 15:51 
AnswerRe: I have some questions in C# Pin
Not Active28-Dec-06 17:21
mentorNot Active28-Dec-06 17:21 
AnswerRe: I have some questions in C# Pin
Flysocket28-Dec-06 20:09
Flysocket28-Dec-06 20:09 
QuestionHow to create and fill DBF with code page 866? Pin
Salogus28-Dec-06 14:14
Salogus28-Dec-06 14:14 
AnswerRe: How to create and fill DBF with code page 866? Pin
ednrgc29-Dec-06 7:57
ednrgc29-Dec-06 7:57 
QuestionRe: How to create and fill DBF with code page 866? Pin
Salogus29-Dec-06 13:25
Salogus29-Dec-06 13:25 
QuestionProgram can't run: "The application has failed to start because its side-by-side configuration is incorrect" Pin
Super Lloyd28-Dec-06 13:27
Super Lloyd28-Dec-06 13:27 
QuestionMulti-frame Tiff files Pin
whatever10128-Dec-06 12:47
whatever10128-Dec-06 12:47 
QuestionDeployment with .mdb Pin
amatbrewer28-Dec-06 12:38
amatbrewer28-Dec-06 12:38 
AnswerRe: Deployment with .mdb Pin
PIEBALDconsult28-Dec-06 12:53
mvePIEBALDconsult28-Dec-06 12:53 
GeneralRe: Deployment with .mdb Pin
amatbrewer19-Jan-07 8:50
amatbrewer19-Jan-07 8:50 
AnswerRe: Deployment with .mdb Pin
Seishin#29-Dec-06 4:51
Seishin#29-Dec-06 4:51 
GeneralRe: Deployment with .mdb Pin
PIEBALDconsult29-Dec-06 5:28
mvePIEBALDconsult29-Dec-06 5:28 
QuestionTurning off the insertion point. Pin
Jamestown4828-Dec-06 12:11
Jamestown4828-Dec-06 12:11 
AnswerRe: Turning off the insertion point. Pin
Judah Gabriel Himango28-Dec-06 12:26
sponsorJudah Gabriel Himango28-Dec-06 12:26 
AnswerRe: Turning off the insertion point. Pin
PIEBALDconsult28-Dec-06 12:56
mvePIEBALDconsult28-Dec-06 12:56 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 15:09
Jamestown4828-Dec-06 15:09 

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.