|
hi
i seeking an easy way to send email in a windows32 application
sepel
|
|
|
|
|
Have a look at Nish's article here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
See here and here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am new to eVC, I want to know how can I compile eVC++ project using NMAKE
or equivalent for eVC++ project.How can i write a batch file to do so?
thanks in advance.
-- modified at 3:50 Friday 4th May, 2007
priyank
|
|
|
|
|
Hello everybody,
I am actually migrating an existing project from VC6 to VC2005. I had a problem with an ActiveX component that wasn't loading at runtime, all other components were loading except the ActiveX. I dug in more and found out that the SplitDialogTemplate() function of the atlwin.h in VC6 differs a lot from the same function in VC2005.
In VC6 it copies all the components (OLE and non-OLE), while in VC2005 it only copies the non-OLE components. Does anyone know any turnaround that can help me load the ActiveX component?
This is the piece of the code that calls SplitDialogTemplate();
HGLOBAL hResource = LoadResource(hInstResource, hDlg);
DLGTEMPLATE* pDlg = (DLGTEMPLATE*)LockResource(hResource);
LPCDLGTEMPLATE lpDialogTemplate = SplitDialogTemplate(pDlg, pInitData);
HINSTANCE hInst = _Module.GetModuleInstance();
nRet = ::DialogBoxIndirectParamA(hInst, lpDialogTemplate, hWndParent,
pDialogProc, dwInitParam);
if (lpDialogTemplate != pDlg)
GlobalFree(GlobalHandle(lpDialogTemplate));
UnlockResource(hResource);
FreeResource(hResource);
Thank you in advance,
Ray
|
|
|
|
|
Hi!
In my application I am using multithreading.
for that I have used the loop.
HANDLE hThread[3];
<br />
for(int i=0;i<3;i++)<br />
{<br />
hThread[i]=(HANDLE)_beginthreadex(NULL, 0, &Thread ,l,NULL, &threadID);<br />
}<br />
<br />
<br />
unsigned __stdcall Thread(void* pArguments )<br />
{<br />
HRESULT hr=NULL;<br />
struct argument_list *Lparam= (argument_list *)pArguments ;<br />
Package pkg;<br />
threadID++;<br />
<br />
DWORD dw=WaitForMultipleObjects(ListBoxItemCount,hThread,TRUE,5000 ); <br />
<br />
switch (dw)<br />
{ <br />
case WAIT_OBJECT_0 + 0:<br />
hr=pkg.EncodeMediaContent(Lparam->pszInFile,Lparam->pszOutFil,Lparam->hwndParent,Lparam->Host,Lparam->UserID,Lparam->InitPackageRequest,Lparam->ScriptFile,Lparam->Port,Lparam->hList,Lparam->_ProtectSet,Lparam->hWndinoutfiledir,Lparam->hwndEncrypt); <br />
break;<br />
<br />
case WAIT_OBJECT_0 + 1:<br />
hr=pkg.EncodeMediaContent(Lparam->pszInFile,Lparam->pszOutFil,Lparam->hwndParent,Lparam->Host,Lparam->UserID,Lparam->InitPackageRequest,Lparam->ScriptFile,Lparam->Port,Lparam->hList,Lparam->_ProtectSet,Lparam->hWndinoutfiledir,Lparam->hwndEncrypt); <br />
break;<br />
<br />
case WAIT_OBJECT_0 + 2:<br />
hr=pkg.EncodeMediaContent(Lparam->pszInFile,Lparam->pszOutFil,Lparam->hwndParent,Lparam->Host,Lparam->UserID,Lparam->InitPackageRequest,Lparam->ScriptFile,Lparam->Port,Lparam->hList,Lparam->_ProtectSet,Lparam->hWndinoutfiledir,Lparam->hwndEncrypt); <br />
break;<br />
<br />
case WAIT_FAILED:<br />
break;<br />
<br />
case WAIT_TIMEOUT:<br />
break;<br />
} <br />
if(hr==S_OK)<br />
{ <br />
MessageBox(0,L"thread gone finished" ,L"therad",0);<br />
_endthreadex( 0 ); <br />
}<br />
threadID--;<br />
return 0;<br />
}
how these worker thread works and how they will run.
means ,how can i identified that which thread work at hThread[threadID/*it is Relevant with i */ ],
1)I have to wait/stop the main thread until the work threads finished his task.
2)when can all thread start. or will it start immidate at the loop time or first it will create all. then it start ?
becuse in my application when i debug some started with loop and some afterwards.
-- modified at 7:09 Friday 4th May, 2007
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Hi!
The threads are all created in the loop.
However they are created in a suspended state. The scheduler of the operating sytem will activate them (put them in running state) according to their priority and overall system load.
Usually this will be in the order you create the threads.
In prinzipal using a static (global) variable as a thread counter is a good idea.
But I strongly recommend to put the access to this variable into a critical section just for the case that the read and write operation (and whatever you will add in future) is not atomic.
Since the worker threads are identical clones it does not matter if the creation sequence would deviate from the sequence the threads start. However, if you want to know the creation sequence in the thread, you can just pass your loop index i as parameter.
kind regards
Leo
|
|
|
|
|
thanks !
but now i am in big confusion here.i have used array of handle right!
now runtime which handle will comes at which stage how can i know that?
becuse
hThread[0]=....
hThread[1]=....
hThread[2]=....
hThread[3]=....
and at WaitForMultipleObjects(ListBoxItemCount,hThread,TRUE,0);
we write only the base hThread address the how the thread identified. by system.
hThread[i], i think it was my wrong idea , because after then it gives me the constant handle error ,
anyways I just want to know why the above method fail.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
OK, I'm no specialist for WaitObject.
And I still do not understand what the code is intended for.
But lets start from the beginning.
You are creating 3 threads (thread 0 to thread 2)
While you have hardcoded the three in the loop index you use the variable ListBoxItemCount in the thread.
Looking at your previous answer you say hThread[0] ... hThread[3].
How much is ListBoxItemCount?
Because hThread[3] is never initialized.
In the way the code is now, it could happen that a task switch occurs in the thread starting loop, after one or two threads where created. In this case the Wait function must fail because not all thread handles in the list are initialized.
I understand that this is only a sample code to demonstrate your problem. But I have also doubts that you are going in the right direction. It is very likely, that if you change your design, the code that troubles you will disappear.
Greets
Leo
|
|
|
|
|
Amit, please do not email me or anyone else directly asking for help.
I saw you've previously done so at least to brahmma earlier and twice to me today.
Chris Maunder wrote:
Everyone here helps because they enjoy helping others, not because it's their job.
in this[^] valuable post.
Regarding your threading problem, I have the following opinion:
amitmistry_petlad wrote:
1)I have to wait/stop the main thread until the work threads finished his task.
This implies that you've misunderstood the concept of multithreading since you're still doing things in serial. Spawning other threads is for doing things in parallel.
You have to re-evaluate your design.
I also suggest you read Joe Newcomer's article about worker threads here[^] before asking more questions. The article will help you understand the basics, asking the "right" questions in this forum and the answers you get will also make more sense to you.
The article refers to how to use MFC classes, but the concept of multithreading is still the same. You don't seem to be using MFC, but you haven't stated that clearly in any of your posts so I'm not really sure whether you use MFC or not.
I also advise you to read the other articles Joe refers to in his article about multithreading to get a more complete picture of the concept.
In my opinion, Newcomer's article explains the basics of multithreading better than any article I've found.
I really hope this helps you.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Extremely Sorry !
In future, I will take care .
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
i have to sense the finger print from a sensor and to generate a key for it. how to do this with mfc. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Did you check out the CFingerPrint class?
Provide enough information, or nobody will be able to help you.
|
|
|
|
|
i searche for CFingerPrint class. but there is no result
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
You searched for CFingerPrint ? That was a joke! You need to split this task before you can get some help. You can't ask a question like "How do I get this application developed?". Read the sticky post at the top of this page, which says "How to get an answer to your question". How far have you succeeded in developing this application? Do you have a problem reading data from the finger print device or do you not know how to generate a key from the data you receive from the device?
|
|
|
|
|
i dont know how to read the data from finger print and to genrate key for it. i didnt ask for the code. just an idea. since iam new to this concept
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Do you have any APIs or libraries for the device? (From the manufacturer of the device)
|
|
|
|
|
Griaule fingerprint recognition - They have an SDK. Download it here[^]. Additionally, google for download+fingerprint+sdk.
|
|
|
|
|
i am having the sensor in a usb drive
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: i am having the sensor in a usb drive
You can keep that.
By the way, did you download and try the SDK that I pointed out in my previous post?
"The difficulty lies, not in the new ideas, but in escaping from the old ones."
-- John Maynard Keyes, 1936
|
|
|
|
|
The CFingerPrint class? That's old-skool.
I use the CSwissArmyKnife and CDuctTape classes - they fix EVERYTHING!
Thanks for the reply about WM_KEYDOWN handling the other day. I couldn't find the original post
to thank you
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: Thanks for the reply about WM_KEYDOWN handling the other day. I couldn't find the original post
to thank you
You're welcome. Here it is[^]
Mark Salsbery wrote: I use the CSwissArmyKnife and CDuctTape classes - they fix EVERYTHING!
Hey, CDuctTape is obsolete. You need to use the CDuctTapeEx class, which is the latest.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
brahmma wrote: Hey, CDuctTape is obsolete. You need to use the CDuctTapeEx class, which is the latest.
Excellent! Thanks for the heads-up!
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi deeps_cute
if u know about finger print sensor then please give me some idea about this
thanks
hi
|
|
|
|
|