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

Managed C++/CLI

 
AnswerRe: Creation of a Word 2007 document using the Open XML Format SDK using C++/CLI Pin
jschell4-May-11 8:45
jschell4-May-11 8:45 
QuestionHow can I pass different CmdLine arguments to the already running process in VC++? Pin
DotNet.Agrawal27-Apr-11 0:23
DotNet.Agrawal27-Apr-11 0:23 
AnswerRe: How can I pass different CmdLine arguments to the already running process in VC++? Pin
Richard MacCutchan27-Apr-11 1:39
mveRichard MacCutchan27-Apr-11 1:39 
QuestionHow to run Linux cpp excutable in winows os? Pin
mathivanaan26-Apr-11 17:06
mathivanaan26-Apr-11 17:06 
AnswerRe: How to run Linux cpp excutable in winows os? Pin
Luc Pattyn26-Apr-11 17:52
sitebuilderLuc Pattyn26-Apr-11 17:52 
AnswerRe: How to run Linux cpp excutable in winows os? Pin
DaveX8628-Apr-11 7:38
DaveX8628-Apr-11 7:38 
AnswerRe: How to run Linux cpp excutable in winows os? Pin
jschell28-Apr-11 8:32
jschell28-Apr-11 8:32 
QuestionMixed C++/CLI code with Berkeley DB Pin
anti.AS24-Apr-11 23:26
anti.AS24-Apr-11 23:26 
Hi, I'm traying to use Berkeley DB in C++/CLI with /clr mode. I wrote two applications, one will store to a database and another one will try to read the contents of that database, but i failed in doing that!
This the first code (first app) for writing to a database:
#include "stdafx.h"
#pragma comment(lib,"libdb51")
using namespace System;
using namespace System::Runtime::InteropServices;

int main(array<System::String ^> ^args)
{
Db SigDb(0,0);
unsigned int oFlags= DB_CREATE;
SigDb.open(NULL,"SigDb.db",0,DB_BTREE,oFlags,0);
String^ HexSig="1E81F1C1176434";
wchar_t* a=( wchar_t* )Marshal::StringToHGlobalUni(HexSig).ToPointer() ;
wchar_t* A=( wchar_t* )Marshal::StringToHGlobalUni(HexSig).ToPointer();;

Dbt key1(a,100);
Dbt data1(A,100);

int ret= SigDb.put(NULL,&key1,&data1, DB_NOOVERWRITE);
if(ret==DB_KEYEXIST){
Console::WriteLine("You are trying to insert an exist key!");
}

SigDb.close(0);
Marshal::FreeHGlobal(IntPtr(A));
Marshal::FreeHGlobal(IntPtr(a));
return 0;
}


and this is the second code for reading from the database:
#include "stdafx.h"
#pragma comment(lib,"libdb51")
using namespace System;
using namespace System::Runtime::InteropServices;

int main(array<System::String ^> ^args)
{
Db SigDb(0,0);
unsigned int oFlags= DB_CREATE;
SigDb.open(NULL,"SigDb.db",0,DB_BTREE,oFlags,0);
String^ HexSig="1E81F1C1176434";
wchar_t* a=( wchar_t* )Marshal::StringToHGlobalUni(HexSig).ToPointer();

SigDb.open(NULL,"SigDb.db",0,DB_BTREE,oFlags,0);
wchar_t DDData[200];
Dbt getKey, getData;
getKey.set_data(a);

getKey.set_size(100);
getData.set_data(DDData);
getData.set_ulen(200);
getData.set_flags(DB_DBT_USERMEM);

if(SigDb.get(NULL,&getKey,&getData,0)==DB_NOTFOUND)
Console::WriteLine("Not Found !");
else
Console::WriteLine(" {0}",Marshal::PtrToStringUni((IntPtr)DDData));

Marshal::FreeHGlobal(IntPtr(a));

Console::ReadLine();
return 0;
}


always the second app says "Not found"! On the other hand when i tried to write the same data twise in the database using the first code, it says "You are trying to insert an exist key!" and that proves that the data was written! Any idea pls!
AnswerRe: Mixed C++/CLI code with Berkeley DB Pin
jschell25-Apr-11 8:26
jschell25-Apr-11 8:26 
GeneralRe: Mixed C++/CLI code with Berkeley DB Pin
anti.AS25-Apr-11 8:34
anti.AS25-Apr-11 8:34 
GeneralRe: Mixed C++/CLI code with Berkeley DB Pin
jschell26-Apr-11 8:05
jschell26-Apr-11 8:05 
GeneralRe: Mixed C++/CLI code with Berkeley DB Pin
anti.AS26-Apr-11 10:20
anti.AS26-Apr-11 10:20 
Questionboost:asio Pin
Alan Kurlansky22-Apr-11 6:42
Alan Kurlansky22-Apr-11 6:42 
AnswerRe: boost:asio Pin
Richard MacCutchan22-Apr-11 22:42
mveRichard MacCutchan22-Apr-11 22:42 
AnswerRe: boost:asio Pin
Albert Holguin28-Apr-11 15:01
professionalAlbert Holguin28-Apr-11 15:01 
QuestionCursor, converting code from vb.net to c++ Pin
Andreoli Carlo21-Apr-11 2:48
professionalAndreoli Carlo21-Apr-11 2:48 
AnswerRe: Cursor, converting code from vb.net to c++ Pin
Andreoli Carlo21-Apr-11 3:13
professionalAndreoli Carlo21-Apr-11 3:13 
QuestionDeployment of Managed C++ application Pin
pix_programmer14-Apr-11 20:55
pix_programmer14-Apr-11 20:55 
Questioncreating new instance using com smart pointer fails Pin
Dhadhan13-Apr-11 18:18
Dhadhan13-Apr-11 18:18 
AnswerRe: creating new instance using com smart pointer fails Repost Pin
Richard MacCutchan13-Apr-11 22:20
mveRichard MacCutchan13-Apr-11 22:20 
QuestionSounds in .Net. How? Pin
Cyclone_S2-Apr-11 13:26
Cyclone_S2-Apr-11 13:26 
AnswerRe: Sounds in .Net. How? Pin
Richard Andrew x642-Apr-11 16:02
professionalRichard Andrew x642-Apr-11 16:02 
QuestionAny update on Intellisense for C++/CLI in VS2010 Pin
Ger Hayden1-Apr-11 8:44
Ger Hayden1-Apr-11 8:44 
AnswerRe: Any update on Intellisense for C++/CLI in VS2010 Pin
John Schroedl2-Apr-11 13:46
professionalJohn Schroedl2-Apr-11 13:46 
GeneralRe: Any update on Intellisense for C++/CLI in VS2010 Pin
T21026-Apr-11 17:29
T21026-Apr-11 17:29 

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.