Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
GeneralUpdate Stored Procedure throws Exception "Expects Parameter..." Pin
STW7-Jun-04 3:05
STW7-Jun-04 3:05 
GeneralRe: Update Stored Procedure throws Exception "Expects Parameter..." Pin
Heath Stewart7-Jun-04 3:42
protectorHeath Stewart7-Jun-04 3:42 
GeneralScrollable control with gradient background Pin
ongo7-Jun-04 3:03
ongo7-Jun-04 3:03 
Generalcode for db acess in C# Pin
Md Saleem Navalur7-Jun-04 2:33
Md Saleem Navalur7-Jun-04 2:33 
GeneralRe: code for db acess in C# Pin
Heath Stewart7-Jun-04 4:05
protectorHeath Stewart7-Jun-04 4:05 
GeneralMalformed Web Response Pin
MrEyes7-Jun-04 2:06
MrEyes7-Jun-04 2:06 
GeneralRe: Malformed Web Response Pin
Heath Stewart7-Jun-04 3:48
protectorHeath Stewart7-Jun-04 3:48 
Generalarray marshalling from c# to COM Pin
rana747-Jun-04 1:04
rana747-Jun-04 1:04 
Here is a sample of a small c# assembly passing a string array
public enum WeatherType
{
Cloudy=0,
Sunny,
Windy
}
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWeatherSink
{


//for arrays
string[] WeatherOptions();

[return : MarshalAs(UnmanagedType.LPArray,SizeConst =4)] string[] WeatherOptionsasArray();


}
Now by default,the array is marshalled as safearray ,as confirmed from teh typelib.
Now the second line attempts to marshall the array as LPArray type.
The ATL client invokes these methods as

SAFEARRAY* _safe=cpi->WeatherOptions();
wcstombs(weathertype,(BSTR)_safe[0].pvData,512);
cout << " safearray dimensions " << _safe->cbElements << " " << weathertype << endl;

The invocation of the above is successful.However executing the foolowing

//now receive it marshalled as BSTR* array
BSTR* _bstarray=cpi->WeatherOptionsasArray();

gives the following error
The value of ESP was not properly saved across a function call.
Why is this happening? How should this be invoked
GeneralRe: array marshalling from c# to COM Pin
Heath Stewart7-Jun-04 5:36
protectorHeath Stewart7-Jun-04 5:36 
GeneralRe: array marshalling from c# to COM Pin
rana747-Jun-04 18:41
rana747-Jun-04 18:41 
Questionwhich class can analyse HTTP? Pin
Xytme6-Jun-04 23:50
Xytme6-Jun-04 23:50 
AnswerRe: which class can analyse HTTP? Pin
Heath Stewart7-Jun-04 5:24
protectorHeath Stewart7-Jun-04 5:24 
QuestionWhere does PrintPreview store the doc ? Pin
sachinkalse6-Jun-04 23:37
sachinkalse6-Jun-04 23:37 
AnswerRe: Where does PrintPreview store the doc ? Pin
Heath Stewart7-Jun-04 5:28
protectorHeath Stewart7-Jun-04 5:28 
Questionhow to share dll? Pin
khchan6-Jun-04 23:37
khchan6-Jun-04 23:37 
AnswerRe: how to share dll? Pin
bneacetp6-Jun-04 23:49
bneacetp6-Jun-04 23:49 
GeneralRe: how to share dll? Pin
khchan7-Jun-04 5:10
khchan7-Jun-04 5:10 
GeneralRe: how to share dll? Pin
Heath Stewart7-Jun-04 5:42
protectorHeath Stewart7-Jun-04 5:42 
GeneralRe: how to share dll? Pin
LongRange.Shooter8-Jun-04 4:34
LongRange.Shooter8-Jun-04 4:34 
Generalwhich class can analyse HTTP. Pin
Xytme6-Jun-04 23:09
Xytme6-Jun-04 23:09 
GeneralRe: which class can analyse HTTP. Pin
Heath Stewart7-Jun-04 4:52
protectorHeath Stewart7-Jun-04 4:52 
GeneralRe: which class can analyse HTTP. Pin
Xytme7-Jun-04 15:58
Xytme7-Jun-04 15:58 
GeneralRe: which class can analyse HTTP. Pin
Heath Stewart8-Jun-04 2:43
protectorHeath Stewart8-Jun-04 2:43 
QuestionWich user control is on top? Pin
Klok6-Jun-04 22:59
Klok6-Jun-04 22:59 
AnswerRe: Wich user control is on top? Pin
bneacetp6-Jun-04 23:14
bneacetp6-Jun-04 23:14 

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.