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

Managed C++/CLI

 
AnswerRe: Timer() - anything faster? Pin
Sander Rossel12-May-11 20:22
professionalSander Rossel12-May-11 20:22 
AnswerRe: Timer() - anything faster? Pin
Dave Doknjas12-May-11 12:00
Dave Doknjas12-May-11 12:00 
AnswerRe: Plugging shamelessly Pin
Luc Pattyn12-May-11 12:50
sitebuilderLuc Pattyn12-May-11 12:50 
AnswerRe: Timer() - anything faster? Pin
LiangGuangLin3-Jul-11 18:50
LiangGuangLin3-Jul-11 18:50 
QuestionStrange: CreateWindow fails, but it doesn't Pin
Foothill12-May-11 8:13
professionalFoothill12-May-11 8:13 
AnswerRe: Strange: CreateWindow fails, but it doesn't Pin
John Schroedl12-May-11 11:02
professionalJohn Schroedl12-May-11 11:02 
GeneralRe: Strange: CreateWindow fails, but it doesn't Pin
Foothill12-May-11 11:30
professionalFoothill12-May-11 11:30 
QuestionHow to read data from COMPORT Pin
bqhoang10-May-11 16:46
bqhoang10-May-11 16:46 
AnswerRe: How to read data from COMPORT Pin
Luc Pattyn10-May-11 16:56
sitebuilderLuc Pattyn10-May-11 16:56 
AnswerRe: How to read data from COMPORT Pin
LiangGuangLin3-Jul-11 19:03
LiangGuangLin3-Jul-11 19:03 
GeneralRe: How to read data from COMPORT Pin
bqhoang3-Jul-11 19:46
bqhoang3-Jul-11 19:46 
Questiondecoration of Identifiers Pin
Bram van Kampen7-May-11 14:41
Bram van Kampen7-May-11 14:41 
AnswerRe: decoration of Identifiers Pin
Luc Pattyn7-May-11 15:06
sitebuilderLuc Pattyn7-May-11 15:06 
GeneralRe: decoration of Identifiers Pin
Bram van Kampen8-May-11 5:55
Bram van Kampen8-May-11 5:55 
GeneralRe: decoration of Identifiers Pin
Luc Pattyn8-May-11 6:01
sitebuilderLuc Pattyn8-May-11 6:01 
QuestionCreation of a Word 2007 document using the Open XML Format SDK using C++/CLI Pin
AthreyaRaghu4-May-11 2:11
AthreyaRaghu4-May-11 2:11 
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 

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.