Click here to Skip to main content
15,906,467 members
Home / Discussions / C#
   

C#

 
GeneralResourceManager Pin
15-May-02 10:23
suss15-May-02 10:23 
GeneralBackgroundImage + Centering... Pin
Zombies with Coffee, LLC15-May-02 5:47
professionalZombies with Coffee, LLC15-May-02 5:47 
GeneralRe: BackgroundImage + Centering... Pin
James T. Johnson15-May-02 8:10
James T. Johnson15-May-02 8:10 
GeneralRe: BackgroundImage + Centering... Pin
Zombies with Coffee, LLC15-May-02 8:29
professionalZombies with Coffee, LLC15-May-02 8:29 
Generalms word Pin
shmuelt15-May-02 3:10
shmuelt15-May-02 3:10 
GeneralRe: ms word Pin
SHaroz20-May-02 7:54
SHaroz20-May-02 7:54 
GeneralSetWindowsHookEx Pin
14-May-02 23:41
suss14-May-02 23:41 
GeneralPassing byte array from C# to C++ Pin
Ollie14-May-02 22:48
Ollie14-May-02 22:48 
Hi,

Have a little trouble passing a byte array in C# into a C++ implemented web service, the C# code is:-

FileStream fs = new FileStream("c:\\work\\temp\\Waremouse.mp3", FileMode.Open);

BinaryReader Reader = new BinaryReader(fs);
Reader.BaseStream.Seek(0, SeekOrigin.Begin);

long lLength = Reader.BaseStream.Length;
Int32 nLength = System.Convert.ToInt32(lLength);

byte[] bData = Reader.ReadBytes(nLength);
fs.Close();

//**********************************************
//C++ Web Service.......
m_FileServer.UploadFile("Waremouse.mp3", bData);
//**********************************************

The C++ is implement as COM interface as shown below

__interface IFBFileServerService
{
//Uploads a file onto the web server....
[id(1)] HRESULT UploadFile([in] BSTR bstrFileName, [in] byte* bData);
//Downloads a file from the web server...
[id(2)] HRESULT DownloadFile([in] BSTR bstrFileName, [out, retval] byte** bData);

};

The problem is that an exception is thrown in the client application

Cheers for any help
Confused | :confused:
Generalweb services provider! Pin
zhoujun14-May-02 19:41
zhoujun14-May-02 19:41 
GeneralRe: web services provider! Pin
Ravi Bhavnani14-May-02 19:56
professionalRavi Bhavnani14-May-02 19:56 
GeneralOoops! Pin
Ravi Bhavnani14-May-02 20:00
professionalRavi Bhavnani14-May-02 20:00 
GeneralRe: Ooops! Pin
Nish Nishant14-May-02 20:13
sitebuilderNish Nishant14-May-02 20:13 
GeneralRe: Ooops! Pin
Ravi Bhavnani14-May-02 20:15
professionalRavi Bhavnani14-May-02 20:15 
GeneralRe: Ooops! Pin
zhoujun14-May-02 23:26
zhoujun14-May-02 23:26 
GeneralForms to Web Page Pin
Albert Pascual14-May-02 11:54
sitebuilderAlbert Pascual14-May-02 11:54 
GeneralEvent Pin
RaphaelBr14-May-02 9:43
RaphaelBr14-May-02 9:43 
Generalbyte array type Pin
Ollie14-May-02 7:48
Ollie14-May-02 7:48 
GeneralRe: byte array type Pin
Joshua Nussbaum14-May-02 8:35
Joshua Nussbaum14-May-02 8:35 
GeneralRe: byte array type Pin
Ravi Bhavnani14-May-02 19:58
professionalRavi Bhavnani14-May-02 19:58 
GeneralRe: byte array type Pin
Nish Nishant14-May-02 20:11
sitebuilderNish Nishant14-May-02 20:11 
GeneralRe: byte array type Pin
Ravi Bhavnani14-May-02 20:14
professionalRavi Bhavnani14-May-02 20:14 
Generalfiles watcher Pin
14-May-02 5:09
suss14-May-02 5:09 
GeneralRe: files watcher Pin
Joshua Nussbaum14-May-02 8:36
Joshua Nussbaum14-May-02 8:36 
GeneralRe: files watcher Pin
Ravi Bhavnani14-May-02 19:57
professionalRavi Bhavnani14-May-02 19:57 
GeneralBooks on C# Pin
Rohde14-May-02 3:42
Rohde14-May-02 3:42 

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.