|
If you update your VC6 project to 2005, does it still work ?
saania khan wrote: I have a code ( written by someone else) in Visual Studio 2005. It has a lot of libs etc. specific to .NET, so I have to convert this code to a dll and then use it in my VC# program.
If it's specific to .NET then it's managed code, which means you should be building a managed dll ( in fact, you have to ) and you won't p/invoke that, you'll just import it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How To Get All of Desktop Pixel And Copy to one variable
!=Hight Speed
|
|
|
|
|
This would be better^
-- modified at 5:36 Sunday 24th September, 2006
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Get HDC of desktop win then use GetBitmapBits .
|
|
|
|
|
Hi all,
I want to enumerate files in a folder that has a large amount of files, I use FindFirstFile and FindNextFile but they seem to be slow, furthermore, they extract file attibutes for all files/folders they enumerate...
Anybody has an idea on how to boost performance? or are there othe file enumeration functions I should use??
Plz help
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
FindFirstFileEx allows you to use these options:
typedef enum _FINDEX_SEARCH_OPS
{
FindExSearchNameMatch,
FindExSearchLimitToDirectories,
FindExSearchLimitToDevices
} FINDEX_SEARCH_OPS; MSDN docs also state that these options are advisory only, meaning that the function could ignore it. Your mileage may vary.
Requirements
Client: Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.
Header: Declared in Winbase.h; include Windows.h.
--
Simulcast on Crazy People's Fillings
|
|
|
|
|
Unfortunately, I am targeting windows mobile devices... so, it wont work
Thanks alot
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Bummer.
--
Hey, TiVo! Suggest this!
|
|
|
|
|
<br />
while ((ch = getchar()) !=EOF && isdigit(ch)){<br />
result = result *10 + ch - '0';<br />
}<br />
printf("number is %d\n", result);<br />
i wonder what is '0' means. Is it is null character?
~~~@@@###EZRA###@@@~~~
|
|
|
|
|
EzraYap wrote: result = result *10 + ch - '0';
actually it's not null.. actually it is ascii based calculation.. i.e. '0' ascii value is 41 , '1' will 42 and so on.. so it way of extracting number from char character ... thats logic here
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Thanks. i undestand now.
~~~@@@###EZRA###@@@~~~
|
|
|
|
|
ThatsAlok wrote: thats logic here
The only logical thing to say would be arithmetic
--
Presented in doublevision (where drunk)
|
|
|
|
|
Jörgen Sigvardsson wrote:
The only logical thing to say would be arithmetic
he he he
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Hi All.
I start to learn multiThread and i wrote some simple program.
I dont know why i crash - i try to look into by using debug and i dont see nothing wrong.
IF someone can tell me what i doing in wrong way .... ?
Thanks for any help.
Here the code :
<br />
...<br />
...<br />
<br />
using namespace std;<br />
<br />
CRITICAL_SECTION sc;<br />
<br />
void __stdcall func(LPVOID param)<br />
{<br />
char szBuffer[256];<br />
{<br />
EnterCriticalSection(&sc);<br />
long lVal = *((long*)param);<br />
<br />
<br />
while(lVal > 0)<br />
{<br />
sprintf(szBuffer, "lVal is : %ld \n", lVal--);<br />
printf(szBuffer);<br />
}<br />
LeaveCriticalSection(&sc);<br />
}<br />
}<br />
<br />
<br />
void main(void)<br />
{<br />
HANDLE thread1,thread2;<br />
<br />
long lVal = 10;<br />
<br />
thread1 = CreateThread(NULL,<br />
5,<br />
(LPTHREAD_START_ROUTINE)func,<br />
&lVal,<br />
CREATE_SUSPENDED,<br />
NULL);<br />
<br />
SetThreadPriority(thread1, THREAD_PRIORITY_HIGHEST);<br />
<br />
lVal = 1000;<br />
<br />
thread2 = CreateThread(NULL,<br />
5,<br />
(LPTHREAD_START_ROUTINE)func,<br />
&lVal,<br />
CREATE_SUSPENDED,<br />
NULL);<br />
<br />
SetThreadPriority(thread2, THREAD_PRIORITY_HIGHEST);<br />
<br />
ResumeThread(thread2);<br />
ResumeThread(thread1);<br />
<br />
WaitForSingleObject(thread2, INFINITE);<br />
WaitForSingleObject(thread1, INFINITE);<br />
}<br />
|
|
|
|
|
maybe you have a deadlock, plz check ur algorithm before u check ur code..
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
I don't have deadlock. and the algorithm is fine.
In case deadlock the application will not crash -
If i init the critical section ( in first line of the main i do InitializeCriticalSection(&sc); ) then i avoid the crash but i still see that the second thread get into the critical area even that the first thread is in it.
What wrong in the code ?
|
|
|
|
|
I realy need some help here.
|
|
|
|
|
It seems your problem is EnterCriticalSection
|
|
|
|
|
You missed this one buddy :
InitializeCriticalSection(&cs);
Dont you need to initialize it before you could enter into it?
Add it here:
<br />
char szBuffer[256];<br />
{<br />
InitializeCriticalSection(&cs)------->Here<br />
EnterCriticalSection(&sc);<br />
long lVal = *((long*)param);<br />
Good Luck
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
First of all ... the init of he critical section is need to be in the main and not in the function ( i dont want each of the thread the init it each time it start to run).
Second ... even if i call init in the main i have problem to run the second thread ( its just dont run ).
|
|
|
|
|
Oops didn't read the program fully.CS should be initialized once. Try this.
<br />
#include <conio.h><br />
<br />
using namespace std;<br />
<br />
CRITICAL_SECTION sc;<br />
<br />
void __stdcall func(LPVOID param)<br />
{<br />
AfxMessageBox("in thread");<br />
char szBuffer[256];<br />
long lVal = (*(long*)param);<br />
EnterCriticalSection(&sc);<br />
<br />
CString cs;<br />
cs.Format("%d",lVal);<br />
AfxMessageBox(cs);<br />
<br />
int testVal=lVal;<br />
while(lVal > 0)<br />
{<br />
sprintf(szBuffer, "I'm %d lVal is : %ld \n",testVal,lVal--);<br />
printf(szBuffer);<br />
}<br />
<br />
LeaveCriticalSection(&sc);<br />
AfxMessageBox("done"); <br />
}<br />
<br />
<br />
void main(void)<br />
{<br />
HANDLE thread1,thread2;<br />
<br />
long lVal = 5000;
InitializeCriticalSection(&sc);<br />
thread1 = CreateThread(NULL,5,(LPTHREAD_START_ROUTINE)func,&lVal,CREATE_SUSPENDED,NULL);<br />
<br />
<br />
SetThreadPriority(thread1, THREAD_PRIORITY_HIGHEST);<br />
<br />
long lVal2 = 1000;
<br />
thread2 = CreateThread(NULL,5,(LPTHREAD_START_ROUTINE)func,&lVal2,CREATE_SUSPENDED,NULL);<br />
<br />
SetThreadPriority(thread2, THREAD_PRIORITY_HIGHEST);<br />
<br />
ResumeThread(thread1); Sleep(3000);
ResumeThread(thread2);<br />
<br />
WaitForSingleObject(thread2, 500);
WaitForSingleObject(thread1, 500);
while(getch()!=27);
}<br />
Just did this one for test. Try it and tell me if it's useful or not. It's too late here .. see u tomorrow.. goodnight
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Hi all,
I have a CListCtrl object in my programme. I want to unload or destroy it programmatically. How it is possible.
Please Help me,
Thanks in advance
George
|
|
|
|
|
georgekjolly wrote: have a CListCtrl object in my programme. I want to unload or destroy it programmatically. How it is possible.
have you created that programmatically?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
CListCtrl* pCtrl;
pCtrl->DestroyWindow();
delete pCtrl;
--
Touch eyeballs to screen for cheap laser surgery
|
|
|
|
|
Jörgen Sigvardsson wrote: CListCtrl* pCtrl;
pCtrl->DestroyWindow();
delete pCtrl;
problem if it created statically!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|