|
in CWinTimerThread.cpp
IMPLEMENT_DYNCREATE(CWinTimerThread, CWinThread)
in CWinTimerThread.h
DECLARE_DYNCREATE(CWinTimerThread)
in CMyThread.cpp
IMPLEMENT_DYNCREATE(CMyThread, CWinTimerThread)
in CMyThread.h
DECLARE_DYNCREATE(CMyThread)
i have applied all these macros...
|
|
|
|
|
|
Hi,
For passing info into a user thread you should make a set function
The you create the thread suspended like in your example.
Next you can initialize the thread giving it all the required info, data & objects.
Then you start the thread
CMyThread* pThread = (CMyThread*) AfxBeginThread( RUNTIME_CLASS(CMyThread),
THREAD_PRIORITY_NORMAL, NULL, CREATE_SUSPENDED, NULL);
Commo* pC = new Commo();
pThread->SetCommo(pC);
pThread->ResumeThread();
This seems to me to be the simplest way to achieve this. (I always use this way )
codito ergo sum
|
|
|
|
|
Hi
I am using IWebbrowser2 interface for webbrowser interface on SDI Applicaton
I have problem about Scroll bar.
I don't know why this control is not taking auto matic scroll bar.
because of this page's below part is cutting down.
Can any body suggest me what could be problem here to have auto matic scroll bar on Webbrowser2 Activex control.?
Or any sample example can suggest ,It would be great?
sonani prakash
|
|
|
|
|
Hi.
Are you using Microsoft web browser control? I have used the same in my application and it is showing scroll bars on loading web page in it.
You can get “Microsoft web browser control” from Project>>AddToProject>>Components and Controls>> Registered ActiveX Controls>> Microsoft web browser control.
Sameer Thakur
|
|
|
|
|
Actually In my applicaton we are not using as you have mentioned but It's linked with CHtmlView calss and It's attached using IWebrowser2 interface code.It's not drag an droped control.
Do you have idea which property or things can affect this CHTMLView class?
Thanks,
Prakash
sonani prakash
|
|
|
|
|
hi,
i found a code online regarding how to use windows registry and when i run it visual studio 2005 its running fine..
Now i tried to implement the samething implemented in the code in my application and i found and i am getting this folllowimg error.
"fatal error C1190: managed targeted code requires a '/clr' option"
In my .Cpp file i am using #using <system.dll>
and in stdafx.h i am using
#using <mscorlib.dll>
#using <system.windows.forms.dll>
using namespace System;
using namespace System::Windows::Forms;
using namespace Microsoft::Win32;
#undef MessageBox
please let me know the way to get over this error..
harsha
|
|
|
|
|
The code is using the CLR so you'll need to enable Common Language Runtime support in your project
properties (Configuration Properties/General).
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Thanks a lot its working now
harsha
|
|
|
|
|
To use managed c++, you need to choose option Project-->Properties-->configuration properties-->c/c++-->General-->commaon language runtime support(/clr) .
|
|
|
|
|
harsh_2961 wrote: using namespace Microsoft::Win32;
better ask you CLR based question in ManagedForum[^]
|
|
|
|
|
Thanks a lot its working now
harsha
|
|
|
|
|
You said better ask on the ManagedForum but he said thanks its working now
|
|
|
|
|
WhiteSky wrote: he said thanks its working no
he he he
|
|
|
|
|
Hello friends!
I want to get body of new arrived mail. I'm the beginner. I had tried to get the same by using OnNewMail event. I'm not able to get the body of new mail. But it prompts me whenever new mail arrives.
Here is my code -
void __stdcall CAddin::OnNewMail()
{
MessageBox(NULL,"New Mail Arrived","Success",0);
CComQIPtr<outlook::_application>Application;
CComPtr<outlook::_explorer>Explorer;
Application =m_Application;
Explorer =Application->ActiveExplorer();
CComQIPtr<outlook ::_inspector=""> spInspector;
IDispatch *CurrentItem;
HRESULT hr1 = spInspector->get_CurrentItem (&CurrentItem);
if (FAILED (hr1))
MessageBox(NULL,"get_CurrentItem","ERROR",0);
CComPtr<outlook::_mailitem> MailItem;
MailItem=reinterpret_cast<outlook::_mailitem*>(CurrentItem);
BSTR strbodyofmail;
MailItem->get_Body (&strbodyofmail);
MessageBox (NULL, _com_util::ConvertBSTRToString(strbodyofmail),"Body of mail",0);
}
Is there any another way to get the body of new arrived mail?
I appreciate your immediate help.
Thanks & regards,
Shashi
Shashikant Shinde
|
|
|
|
|
Sorry about that ... I removed the message, I'll mail the code to Shashi.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
|
Shashi,
Could you plz update your email address in your profile so that I can mail the code to you, it's vary long and it's breaking the forum. And please let me know when you have done it.
Thanx
Regards,
-- modified at 2:32 Friday 2nd March, 2007
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Thank U very much!
Right now I'm working on a project which requires parsing of new mail. As per my knowledge, I had done what I wrote. My parser is ready, but coz of this problem I've trouble to go on.
So I request you to please update me on my email id - shashi.shinde81@gmail.com.
Thanks again!
I'm regerly waitimg for ur reply.
Shashi
Shashikant Shinde
|
|
|
|
|
Mail sent ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Thank U, Richard very much. I will check it.
Shashikant Shinde
|
|
|
|
|
|
Dear Sir,
Thanks for ur help.
But this code reads all the mails exist in Inbox.
But I want to get the body of newly arrived mail which is unread only.
I'm getting the message whenever new mail arrives using OnNewMail event. But not able to get body or other details of the same mail item when it arrives.
I've to do all this in outlook addin.
Is there any other solution for the same, or is it possible in C / C++?
Thanks & regards,
Shashi
Shashikant Shinde
|
|
|
|
|
The following code is simple console code. Nothing visual or rocket science about it.
Amazingly, the code prints size of A as 16 and size of B as 12. Char is 1 byte, int is
4 bytes. So both structs should be 10bytes each. Can someone please help me understand
why this is not the case? If you don't believe me, run it and see for yourself.
#include <iostream>
using namespace std;
struct
{
char c1;
int i1;
char c2;
int i2;
}a;
struct
{
int i1;
int i2;
char c1;
char c2;
}b;
int main()
{
cout<<"sizeof struct A " <<sizeof(a);
cout<<"sizeof struct B " <<sizeof(b);
getchar();
return(0);
}
Thanks in advance.
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
In vc++ there is something call structure memeber alignment . Suppose the member alignment value is 4, Then the structure will be having a allocation size of 4 byte. Let me tell you how the struct a become 16 in your case.
first element is char c1. Since the member alignment value is 4, 4 byte will be allocated. So a remaining 3.
Second member i1 is int. Int takes 4 byte. So it will not fit in the previous 3 bytes. Hence it will allocate a new 4 bytes
and so on.. The 16 bytes is occupied as follows
1 - c1
2 - Free
3 - Free
4 - Free
5 - i1
6 - i1
7 - i1
8 - i1
9 - c2
10 - Free
11 - Free
12 - Free
13 - i2
14 - i2
15 - i2
16 - i2
you can change the member alignment setting of the project by changing the /Zp option in the compile setting ( project menu-> setting->C++-> Take Code egenration in the category menu. Now u can find a combobox "Struct member alignment")
You can also change the settings as by putting the Pragma Directives.
#pragma pack( push , 1 )//change the member alignment value to 1<br />
struct{<br />
char c1; <br />
int i1;<br />
char c2;<br />
int i2;}a;<br />
#pragma pack(pop)
-- modified at 1:14 Friday 2nd March, 2007
nave
|
|
|
|