Click here to Skip to main content
15,889,372 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: extend class and casting Pin
teejayem18-Mar-10 8:15
teejayem18-Mar-10 8:15 
GeneralRe: extend class and casting Pin
Andreoli Carlo18-Mar-10 22:05
professionalAndreoli Carlo18-Mar-10 22:05 
QuestionConvert CString array to System::String Pin
Anu_Bala16-Mar-10 18:14
Anu_Bala16-Mar-10 18:14 
AnswerRe: Convert CString array to System::String Pin
Richard MacCutchan16-Mar-10 22:20
mveRichard MacCutchan16-Mar-10 22:20 
AnswerRe: Convert CString array to System::String Pin
teejayem17-Mar-10 2:08
teejayem17-Mar-10 2:08 
AnswerRe: Convert CString array to System::String Pin
T210228-Mar-10 22:07
T210228-Mar-10 22:07 
AnswerRe: Convert CString array to System::String Pin
@Intersect☺™15-Apr-10 0:58
professional@Intersect☺™15-Apr-10 0:58 
Questioncalling a winapi function from managed code Pin
david sturzenegger15-Mar-10 6:04
david sturzenegger15-Mar-10 6:04 
hi, i have a problem when calling from the managed code the function

capGetDriverDescription(
WORD wDriverIndex,
LPTSTR lpszName,
INT cbName,
LPTSTR lpszVer,
INT cbVer
);
from avicap32.dll. the function is described in detail in http://msdn.microsoft.com/en-us/library/dd756909%28VS.85%29.aspx[^]. Basically it writes the name and description of videoinput device number wDriverIndex to the passed strings lpszName and lpszVer which have length cbName and cbVer respectively (better put, to the corresponding memory). the relevant code is the following

-----------------------------------------

[DllImport("avicap32.dll")] extern "C" bool capGetDriverDescription(UInt16, String^, int, String^, int);

.....

int i_nameLen = 100;
int i_verLen = 100;
String^ s_name = gcnew String('x',i_verLen);
String^ s_ver = gcnew String('x',i_verLen);

result = capGetDriverDescription(x, s_name, i_nameLen, s_ver, i_verLen);

------------------------------------------

the function returns for x=0 true and for x=1 false which is expected since only one webcam is attached to my computer. but the returned strings s_name and s_ver are unchanged. probably managed and unmanaged code dont use the same memory which makes it somewhat difficult to pass pointers.... what is the alternative?
btw, its my first time calling unmanaged code from managed one, so probably the answer will be quite obvious. thanks in advance!

david

ps: is there a smarter way to allocate memory to the strings? (probably yes...)
AnswerRe: calling a winapi function from managed code Pin
Ghydo19-Mar-10 7:34
Ghydo19-Mar-10 7:34 
QuestionSome help needed with class and this pointer Pin
nah133712-Mar-10 13:06
nah133712-Mar-10 13:06 
AnswerRe: Some help needed with class and this pointer Pin
Garth J Lancaster12-Mar-10 15:14
professionalGarth J Lancaster12-Mar-10 15:14 
GeneralRe: Some help needed with class and this pointer Pin
nah133712-Mar-10 20:57
nah133712-Mar-10 20:57 
GeneralRe: Some help needed with class and this pointer Pin
Richard MacCutchan12-Mar-10 22:21
mveRichard MacCutchan12-Mar-10 22:21 
QuestionManaged c++ std::string not accessible in unmanaged c++ Pin
Radh-e-sham11-Mar-10 20:42
Radh-e-sham11-Mar-10 20:42 
AnswerRe: Managed c++ std::string not accessible in unmanaged c++ Pin
KarstenK11-Mar-10 21:46
mveKarstenK11-Mar-10 21:46 
AnswerRe: Managed c++ std::string not accessible in unmanaged c++ Pin
T210228-Mar-10 22:10
T210228-Mar-10 22:10 
Questionsse 2-D Inner product and transpose Pin
SMART LUBOBYA4-Mar-10 4:24
SMART LUBOBYA4-Mar-10 4:24 
QuestionIs it possible to implement a DataSource in a mixed-mode DLL? Pin
Ron Aldrich3-Mar-10 22:38
Ron Aldrich3-Mar-10 22:38 
AnswerRe: Is it possible to implement a DataSource in a mixed-mode DLL? Pin
N a v a n e e t h4-Mar-10 4:24
N a v a n e e t h4-Mar-10 4:24 
GeneralRe: Is it possible to implement a DataSource in a mixed-mode DLL? Pin
Ron Aldrich4-Mar-10 9:53
Ron Aldrich4-Mar-10 9:53 
QuestionInterface operator bug or feature with implicit/explicit cast ? Pin
Edward Diener3-Mar-10 2:43
Edward Diener3-Mar-10 2:43 
AnswerRe: Interface operator bug or feature with implicit/explicit cast ? Pin
Nish Nishant10-Mar-10 2:58
sitebuilderNish Nishant10-Mar-10 2:58 
GeneralRe: Interface operator bug or feature with implicit/explicit cast ? Pin
Edward Diener10-Mar-10 4:13
Edward Diener10-Mar-10 4:13 
QuestionBACKGROUNDWORKER in vc++ clr net 2.0 need example Pin
ajaxswan1-Mar-10 23:15
ajaxswan1-Mar-10 23:15 
AnswerRe: BACKGROUNDWORKER in vc++ clr net 2.0 need example Pin
N a v a n e e t h1-Mar-10 23:27
N a v a n e e t h1-Mar-10 23:27 

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.