|
|
Well friday night is going to be fun for me! haha. I'll let you know. Thanks
|
|
|
|
|
Two examples:
char name[260] = "Apple";
char *pname = new char[260];
strcpy(pname, name);
vector<char *> array1;
array1.push_back(pname);
vector<string> array2;
array2.push_back(name);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
if I do
strcpy(m_cProcessList[m_iProcessCount], stpePrcEntry32.szExeFile);
where m_cProcessList[m_iProcessCount] is a pointer to the current stpePrcEntry32.szExeFile is of type CHAR then it compiles but it doesnt work. I get:
Unhandled exception at 0x102af679 (msvcr80d.dll) in blueline.exe: 0xC0000005: Access violation writing location 0xcccccccc.
I think I need to convert stpePrcEntry32.szExeFile to something else first.
|
|
|
|
|
Nicola Curran wrote: strcpy(m_cProcessList[m_iProcessCount], stpePrcEntry32.szExeFile);
What is m_cProcessList declared as? What value does m_iProcessCount have?
This will obviously not work:
char *pname;
strcpy(pname, "My name is X");
Nicola Curran wrote: I think I need to convert stpePrcEntry32.szExeFile to something else first.
No, but you do need to have a better understanding of pointers.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
This field is actually defined as TCHAR szExeFile[MAX_PATH]; , where TCHAR is either an ASCII or wide character depending on your configuration type (although the doc implies Unicode only). Assuming that you are using this in conjunction with Process32First()/Process32Next() then each call will return the exe path name in this field. If you then wish to store these names in an array you will need to copy them to a new buffer whose address is stored in the array. If your code is non-unicode then you will also need to convert the strings from Unicode to mbcs types.
|
|
|
|
|
typedef struct tagPROCESSENTRY32
{
DWORD dwSize;
DWORD cntUsage;
DWORD th32ProcessID; // this process
ULONG_PTR th32DefaultHeapID;
DWORD th32ModuleID; // associated exe
DWORD cntThreads;
DWORD th32ParentProcessID; // this process's parent process
LONG pcPriClassBase; // Base priority of process's threads
DWORD dwFlags;
CHAR szExeFile[MAX_PATH]; // Path
} PROCESSENTRY32;
this is the struct, and CHAR is typedef char CHAR; ... or am i using a wrong version of the file?
|
|
|
|
|
Nicola Curran wrote: this is the struct, and CHAR is typedef char CHAR; ... or am i using a wrong version of the file?
You are correct, I looked at the MSDN documentation and it showed me the 'generic' version. The version you have is fine and should return you exe path names in ASCII.
|
|
|
|
|
I am Create navigation icon i want to create baloon for that which contain come control eg. link. And how thay handle.
|
|
|
|
|
Has this something to do with C++ ?
|
|
|
|
|
You already had a good reply 4 1/2 hours ago to your question. If you read the article pointed to, it has a button, with a big "balloon", with links in it.
Have a fun evening reading,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
i tried a lot to pass array to excel sheet using xloper structure hear is sample function i wrote to pass array using xloper
<code>__declspec(dllexport) LPXLOPER xarr ()
{
static XLOPER xlArray;
XLOPER xlValues[4];
int i;
for (i = 0; i < 4; ++i)
{
carr[i]=i*2;
xlValues[i].val.num = i+10;
xlValues[i].xltype = xltypeNum;
}
//this will generate array with 4 element 10,11,12,13
xlArray.xltype = xltypeMulti;
xlArray.val.array.lparray = &xlValues;
xlArray.val.array.rows = 1;
xlArray.val.array.columns = 4;
return (LPXLOPER) &xlArray;
}</code>
above function gives only first value of array i.e.10 in the cell from which function call is made
is there is any way to fill the other cell? as i am giving no of row and column in xloper it should fill 3 cell also but that is not happening
please help me in identifying my mistek
Thanex a looot in advance
|
|
|
|
|
i am showing media player on dialog box using MCIWNDCreate function as follows
HWND h_video ;
h_video = MCIWndCreate(this->GetSafeHwnd(),
AfxGetInstanceHandle(),
WS_CHILD |WS_VISIBLE|MCIWNDF_NOMENU|SWP_FRAMECHANGED,filePath);
here h_video is handle of window
by using MCIWNDPlay(h_video);it will play audio file
but it will show that media player on top of dialog box but i want to show that player on anywhere on dialog box.Plz if anyone know this plz tell me how can i show that media on anywhere on dialog box.
|
|
|
|
|
Since MCIWndCreate() returns a HWND , you can use any of the Win32 functions such as MoveWindow() or SetWindowPos() to operate on the window.
|
|
|
|
|
i am new driver development .
i want to know how to create project display Mirror driver project with vs...
is there any wizard to create this project or i will create from begin.
please help me.
thanks
|
|
|
|
|
|
i know how to create project of ddk mirror driver
but i dont know how to debug it
i use ddkbuild but i dont know to use it.
may give some project with ddkbuild
|
|
|
|
|
|
Hi,
I use connection to sql server:
Internal::_ConnectionPtr m_pConnection;
m_pConnection.CreateInstance( __uuidof( Internal::Connection ) );
when I am currently testing my application in remote (server sqlserver in another machine) everything works as it should.
But when I simulate a network outage (disconnect and reconnect the cable network) and I run a query to read attributes (for example) I noticed that my application does not know the basis which has been connected even though the tests on the connection it gives me yet opened(pConnection->GetState() = adStateOpen)!
So I wonder how to know if there is a network outage or how to create a connection attempt and also the best test on the connection that it is still connected to my database.
Thank you
|
|
|
|
|
With MS VC6.0 :
Can printf() and the other derivatives such as CString::Format() be made to produce comma thousand seperated formated numbers ?
I tried the following code but it does not seem to be supported:
long n = 4523123 ;<br />
printf("%'ld", n) ;
Expected Result : 4,523,123
|
|
|
|
|
Hi Neil,
I would suggest using the GetNumberFormat Function[^] with the locale id of English_USA.1252.
TCHAR szFormatted[MAX_PATH] = {0};
LCID lc = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
GetNumberFormat(lc,0,_T("4523123"),NULL,szFormatted,ARRAYSIZE(szFormatted));
Best Wishes,
-David Delaune
|
|
|
|
|
Neil Urquhart wrote: Expected Result : 4,523,123
Tak a look at the "N" type on the MSDN Format specifiers[^] page.
[edit]Sorry my mistake this does not (as David points out below) apply to printf() . I was on the .NET MSDN page and did not look at the header closely enough. [/edit]
modified on Friday, October 23, 2009 8:57 AM
|
|
|
|
|
Richard MacCutchan wrote: Tak a look at the "N" type on the MSDN Format specifiers[^] page.
For printf() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks; my bad 
|
|
|
|
|
Is this implemented in VC6.0 ? MSDN suggests it is VS2003 onwards only.
|
|
|
|