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

Managed C++/CLI

 
AnswerRe: Getting screen width and height Pin
Luc Pattyn7-Jan-10 4:19
sitebuilderLuc Pattyn7-Jan-10 4:19 
AnswerRe: Getting screen width and height Pin
Andreoli Carlo17-Jan-10 22:41
professionalAndreoli Carlo17-Jan-10 22:41 
QuestionSystem::String ^ to LPCWSTR conversion? Pin
Mattzimmerer6-Jan-10 22:27
Mattzimmerer6-Jan-10 22:27 
AnswerRe: System::String ^ to LPCWSTR conversion? Pin
Richard MacCutchan7-Jan-10 0:25
mveRichard MacCutchan7-Jan-10 0:25 
GeneralRe: System::String ^ to LPCWSTR conversion? Pin
Mattzimmerer7-Jan-10 9:14
Mattzimmerer7-Jan-10 9:14 
GeneralRe: System::String ^ to LPCWSTR conversion? Pin
Richard MacCutchan7-Jan-10 9:54
mveRichard MacCutchan7-Jan-10 9:54 
AnswerRe: System::String ^ to LPCWSTR conversion? [modified] Pin
Mark Salsbery7-Jan-10 9:35
Mark Salsbery7-Jan-10 9:35 
QuestionRe: System::String ^ to LPCWSTR conversion? Pin
Mattzimmerer7-Jan-10 9:59
Mattzimmerer7-Jan-10 9:59 
Okay, you guys were a ton of help, but there is still something I am missing. Why dont I just show you what I am trying to do:
I am trying to get a name from a windows forms textbox converted so that I can use it in FindWindowW() so that I can send a PID out to a driver

this code is pretty messy atm, I usually clean it up after I get the proper way to do something. (imo lol)
char* pProcName = (char*)(void*)Marshal::StringToHGlobalUni(this->ProcName->Text);

wchar_t ProcNameWSTR, *pProcNameWSTR = &ProcNameWSTR;

const wchar_t tester[11] = L"Calculator";

int lengthmbc = mbtowc(pProcNameWSTR,pProcName,sizeof pProcName);

unsigned long Returned;
input bInput; //pre defined struct showing the members
bInput.bytestoread;
bInput.processid;
bInput.startaddress;

HWND windowHandle = FindWindowW(NULL, pProcNameWSTR);
HWND windowHandle2 = FindWindowW(NULL, (LPCWSTR) &tester);
if (windowHandle)
      MessageBox::Show("pProcNameWSTR success");//FAIL
if (windowHandle2)
      MessageBox::Show("tester wchar_t success");//SUCCESS

DWORD* processID = new DWORD;
GetWindowThreadProcessId(windowHandle, processID);

DeviceIoControl(
      hFile,						// Device handle
      IOCTL_MZ_READMEMORY,       // Code
      (LPVOID) &bInput,			// Buffer TO driver
      sizeof bInput,				// Size of InBuffer
      NULL,						// Buffer FROM driver
      0,							// Size of OutBuffer
      &Returned,					// Bytes output
      (LPOVERLAPPED) NULL);		// Overlapped struc


the problem is that I cannot get the contents of ProcNameWSTR to match my tester[11] (the first if check fails and the second succeeds) any insight?
AnswerRe: System::String ^ to LPCWSTR conversion? Pin
Mark Salsbery7-Jan-10 12:56
Mark Salsbery7-Jan-10 12:56 
GeneralRe: System::String ^ to LPCWSTR conversion? Pin
Mattzimmerer7-Jan-10 22:01
Mattzimmerer7-Jan-10 22:01 
QuestionHow to Get DataTable column name ?? [modified] Pin
ajaxswan6-Jan-10 18:18
ajaxswan6-Jan-10 18:18 
AnswerRe: How to Get DataTable column name ?? Pin
Andreoli Carlo19-Jan-10 2:30
professionalAndreoli Carlo19-Jan-10 2:30 
Questionhow to declare array of object [modified] Pin
m_mun6-Jan-10 1:02
m_mun6-Jan-10 1:02 
AnswerRe: how to declare array of object Pin
Luc Pattyn6-Jan-10 2:51
sitebuilderLuc Pattyn6-Jan-10 2:51 
AnswerRe: how to declare array of object Pin
Dave Doknjas6-Jan-10 11:45
Dave Doknjas6-Jan-10 11:45 
GeneralRe: how to declare array of object Pin
SteelModule28-Jul-10 5:06
SteelModule28-Jul-10 5:06 
GeneralRe: how to declare array of object Pin
Dave Doknjas28-Jul-10 5:20
Dave Doknjas28-Jul-10 5:20 
GeneralRe: how to declare array of object Pin
SteelModule28-Jul-10 21:49
SteelModule28-Jul-10 21:49 
QuestionDATASET to sqlite.net Pin
ajaxswan4-Jan-10 15:38
ajaxswan4-Jan-10 15:38 
QuestionSystem::String ^ to LPCVOID conversion? [modified] Pin
Mattzimmerer2-Jan-10 10:42
Mattzimmerer2-Jan-10 10:42 
AnswerRe: System::String ^ to LPCVOID conversion? Pin
Richard MacCutchan2-Jan-10 22:04
mveRichard MacCutchan2-Jan-10 22:04 
Questioncoding help Pin
helawae31-Dec-09 19:52
helawae31-Dec-09 19:52 
AnswerRe: coding help Pin
N a v a n e e t h1-Jan-10 3:03
N a v a n e e t h1-Jan-10 3:03 
GeneralRe: coding help Pin
helawae3-Jan-10 21:56
helawae3-Jan-10 21:56 
GeneralRe: coding help Pin
N a v a n e e t h7-Jan-10 18:06
N a v a n e e t h7-Jan-10 18:06 

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.