|
Instead of looking to others for a solution to your problem, try reading RFC 1939. I'm sure it'll answer most of your questions related to the POP3 protocol. Implementing POP3 into a program is a trivial task and I'm sure you'll agree once you know how it works.
http://www.faqs.org/rfcs/rfc1939.html
John
|
|
|
|
|
Try doing a search on, um, codeproject with a phrase of pop3[^], and you get loads of
hits. If you have a specific problem, an author of an article you used, or this
forum may be to help.
Iain.
|
|
|
|
|
Hi
Is there any way to copy the file object to clipboard?
I want to implement Cut, Copy and Paste for files like explorer does.
Regards
Neha
|
|
|
|
|
|
.
modified 1-Dec-11 1:28am.
|
|
|
|
|
Use CreateToolBarEx(...)
for further reading refer MSDN it has a good example how to add buttons, resize, etc.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
thanks alot. I just needed this jump start .
|
|
|
|
|
Hi,
I have developed a small program to read the content from excel sheet in VC++. The developed program is working in Excel 2002 version, but it is not working in Excel 2000. I found that Excel 2002 having "_Application" class, but it is not in Excel 2000. In this project First I have included the "Excel.Exe" Type library. Then I changed the type library with "XL5EN32.OLB". Because this ".OLB" file is exist in both versions. Then I changed my code accordingly with the classes available in the OLB file. The classes I have included are "Application","WorkSheet","WorkSheets","WorkBook",WorkBooks","Range". While compilation time this project is ok. But it is giving the "Runtime" Error. Below I have mentioned the code I got the runtime error.
-----------------------
AfxOleInit(); //Initialization
Application app;
Workbook book;
Worksheet sheet;
Workbooks books;
Worksheets sheets;
Range range;
LPDISPATCH lpDisp;
COleVariant
covTrue((short)true),
covFalse((short)false),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Unable to Create Excel Application");
return;
}
VARIANT var;
var=app.Workbooks(OleVariant("*.XLS")); //I got the RunTime error Here.
lpDisp = var.pdispVal;
books.AttachDispatch(lpDisp);
--------------------------------------------
var=app.Workbooks(OleVariant("*.XLS));
The above line is giving the problem. If anybody knows the solution to this problem, please reply me. Thank you very much.
Ramanan.
RamananS
|
|
|
|
|
At the risk of asking a stupid question, what do you expect that line to do?
I'm assuming that you have a simple typo, and it should be COleVariant("*.XLS"), but that nicety aside, I think you need to understand what the method you're calling actually does.
app.Workbooks( VARIANT ) will return a Workbook object (strictly, a Workbook interface), and the value of the variant can be a numeric index into the collection, between zero and Workbooks.Count-1. It's a shorthand for app.Workbooks.Item(VARIANT). The value of the variant can also be a document name, such as "C:\Documents And Settings\Steve S\My Documents\vacation.xls".
There isn't, unless they've updated the model significantly since I last checked, anything that supports it being a wildcard.
I know all the automation stuff for Excel, Word etc has samples in VB, but I suggest you read the appropriate docs. It's not that hard to figure out. You might also search the MS site for a download called something like B2CSE. This is a simple VB automation to C++ automation conversion tool, and while it's not perfect, is really helpful in circumstances like this.
Steve S
|
|
|
|
|
how can we generate html dynamically through vc++ or c++?
|
|
|
|
|
Simply write out the html tags, a technique followed by many application.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
You can use XML/XSLT to create HTML dynamically.
|
|
|
|
|
See here [^]
onwards and upwards...
|
|
|
|
|
Hello,
Just wondering if any of you would know the answer to this:
For the win32 api function, ::GetFocus(), the docs say "If the calling thread's message queue does not have an associated window with the keyboard focus, the return value is NULL."
So how can you check if your application is active or not?
Thanks,
Swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Swinefeaster wrote:
So how can you check if your application is active or not?
you mean has focus or not ?
Well if it returns null it means its not active, rite ?
If the window returned is other than ur window then again ur window/application is not focused.
If you want to explicitly make ur application active call
SetFocus(...)
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
I am a chinese online-game programmer. Now there is a problem suffering me. In game programming, how can I display the ime windows in fullscreen mode when using the directx 3d technology. Waitting for your helpful solutions.
Thanks!
|
|
|
|
|
I have a question about the proper way of closing a thread with Windows APIs.
This is pseudo code. I left out details for clarity.
HANDLE m_hConEvent};
class ThreadA;
void main(void)
{
ThreadA *pthreadA = new ThreadA(); //Do I need to remove pointer from the heap.
do some stuff...
Wait();
}
class ThreadA
{
public
ThreadA()
{
CreateThread(FuncPtr);
SetEvent(m_hConEvent);
}
~ThreadA() {};
static int FuncPtr()
{
bool bExit;
HANDLE arHandles[] = {m_hTerminatorX, m_hConEvent};
while(bExit)
{
dwWait = WaitForMultipleObjects(2, arHandles, FALSE, INFINITE);
switch(dwWait)
{
case WAIT_OBJECT_0 + 1 :
{
//Do some stuff. Now done with thread or errored out.
SetEvent(m_hTerminatorX);
}
break;
case WAIT_OBJECT_0 :
{
bExit = false;
}
break;
}
}
//Now I'm done with thread do I need to remove *pthreadA pointer?
// Like use "delete this" command to remove the pointer from the heap?
delete this;
}
};
Thanks in advance.
|
|
|
|
|
How about deleteing it in the main function itself ?
This space is empty.
|
|
|
|
|
Thanks for the reply. Unfortunately in this scenario I can’t determine in the main routine when to delete the object.
|
|
|
|
|
Opps sorry for the stupid answer... You are creating a thread.
But i dont think you have access to the this pointer in the static method.
To delete the object in the thread function you need to pass the this pointer to the thread. Then you delete it when the thread has done its job.
But what if the same object initiates 2 threads???? then the second call to delete of the same object will fail.
You have to make sure that the same object does not create another thread.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
The simplest answer is yes, you definitely need to delete the ThreadA that pThreadA points to.
There are a few other things that strike me as notable/strange.
1. FuncPtr is static, and thus has no "this" context. "delete this" will result in a compile time error. Any member functions/variables will also be inaccessible from FuncPtr.
2. If you want to use "delete this", you need FuncPtr to accept a pointer to a the ThreadA object and use it to call an instance function.
e.g.:
int FuncPtr2()
{
// do stuff
return 1;
}
static int FuncPtr(void * param)
{
return ((ThreadA *)param)->FuncPtr2();
}
Now FuncPtr2 has an appropriate context to use "delete this". However, this is probably a bad idea. In my experience, it sometimes leads to strange bugs, and it's just not worth it. In addition, the behavior of "delete this" is undefined if the object "this" points to was allocated on the stack.
My suggestion would be to put some sort of checking mechanism into main. (I assume this is what Wait() is doing.) At the end of the function (or at the end of the relevant section), use this checking mechanism to wait for the thread to complete, and then delete the ThreadA object in the main method.
|
|
|
|
|
I had set the min value and max value to spin by
m_spin.SetRange(250,500);
But then, how to set the step value to spin.
It should increment like 250, 300, 350, 400, 450, 500
Can anyone help me out, please.
It is so urgent. I thank in advance.
Mughilan
|
|
|
|
|
Could not find anything that will do that what you are asking for by default. You have i guess customise it.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Will SetStep(50) not do what you require?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
CSpinButtonCtrl doesn't have a SetStep() method that I can find. I'd try providing a handler for the NM_RELEASEDCAPTURE message that calls GetPos(), adds or subtracts 50, then calls SetPos(). Of course, someone more knowledgable might have a better solution.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|