|
Writing Plug In For MS Outlook
Using C/C++ VisStu 6.0
I am looking for any references, books, code, examples, tutorials for writing a Plug In for MS Outlook.
My Plug In will be an encrytpion module for Outlook email.
Many thanks,
Robert
|
|
|
|
|
<br />
void CEffectsDlg::OnCustomdrawSlider2(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
if(delayOn)<br />
{<br />
m_sl2Val.Format("Val: %d%%", (sl2Max - m_sl2Ctrl.GetPos()));<br />
<br />
UpdateData(FALSE);<br />
}<br />
<br />
*pResult = 0;<br />
}<br />
My problem is that the above code appears to be called before I get a chance to assign delayOn a value (its called immediately when the program is launched). I verified this by sticking a MessageBox in with the above.
A setup() function in OnInitDialog() should stop this from happening by declaring delayOn to be FALSE, but this is obviously being called after OnCustomdrawSlider2.
Is there any way round this?
Cheers.
|
|
|
|
|
Set delayOn to FALSE in the dialog's constructor.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Just as a side comment:
I doubt calling UpdateData() is a good idea in a custom draw routine. If the UpdateData() call changes the value associated with the control and causes the control to be redrawn, you could end up infinitely recursing.
Software Zen: delete this;
|
|
|
|
|
I am interested if someone knows a method to PAUSE a process to freeze it. Not freezing all of it's threads . . . but the process
Thank you!!!
gabby
|
|
|
|
|
It sounds like you're thinking there is a separate 'process thread of execution' that is somehow different or separate from other threads. That is not the case. A Windows process is a collection of one or more threads, executing within a context. In order to 'pause' a process, you would have to suspend all of its threads. This would essentially stop the process from consuming CPU time resources.
What problem are you trying to solve by 'pausing' a process?
Software Zen: delete this;
|
|
|
|
|
Gary R. Wheeler wrote:
What problem are you trying to solve by 'pausing' a process?
Or create.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
That thought did occur to me.
Software Zen: delete this;
|
|
|
|
|
I just wanted toi know if there is any possible way of pausing a process other than pausing all it's threads.
Thank you.
|
|
|
|
|
I need to access / operate on selected document/view. I iterate thru the template / document / view using the well documented process (code snippet follows).
I do not understand why the debug shows returned pointers to the derived class when the API variables are assigned to "base" class as follows:
CDocTemplate *pDocTemplate;
CDocument *pDocument;
CView *pView;
The debug shows derived class name but only the base class functions and variables.
My question is - how do I get to the derived class?
"Standard " iteration:
POSITION positionTemplate = GetFirstDocTemplatePosition();
while(positionTemplate)
{
pDocTemplate = GetNextDocTemplate(positionTemplate);
POSITION positionDoc = pDocTemplate->GetFirstDocPosition();
while(positionDoc)
{
pDocument = pDocTemplate->GetNextDoc(positionDoc);
POSITION positionView = pDocument->GetFirstViewPosition();
while (positionView)
{
pView = pDocument->GetNextView(positionView);
etc.
Thanks for your help.
Vaclav
|
|
|
|
|
Your document class is derived from CDocument, so you can do a direct comparison of the pDocument pointer and the address of your document.
if (pDocument == &MyDocument) You can do the same with the pView and your view.
If you do not have the address of your document and view, and just want to check if the returned pDocument or pView are of the same type as yours, then you can do a dynamic_cast of the pointer. The cast will return NULL if the pointer does not point to an object of your type
CMyView *pMyView = dynamic_cast<CMyView *>(pView);
if (pMyView == NULL)
else
[edit]fixed the < and > characters[/edit]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you, your suggestion basically works.
However if used directy, per MSDN, in the syntax you suggested
CCCImageView *imageView = dynamic_cast <cccimageview*> (pView);
I get "Unhandled Exception....
When I use DYNAMIC_DOWNCAST macro in the following syntax
CCCImageView *imageView = DYNAMIC_DOWNCAST(CCCImageView, pView);
it does exactly what I need to accomplish.
What is really strange - the "dynamic_cast" in MSDN ( January 2001) has reasonable explanation what it does, but the macro is documented rather poorly.
Thanks again
Vaclav
|
|
|
|
|
MSDN[^] does state that the dynamic_cast operator can throw exceptions in two instances:<lu>You are trying to cast a reference (not a pointer) and the cast failed.The typeid of the pointer or reference can not be determined.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Does anyone know the easiest way to ensure that a string of a folder path does indeed refer to a real folder in C++/MFC?
Joel Holdsworth
|
|
|
|
|
GetFileAttributes(szPath) != (DWORD)-1
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I like this method. Although I think it should be:
GetFileAttribute(szPath) == FILE_ATTRIBUTE_DIRECTORY Thanks for the hint!
Joel Holdsworth
|
|
|
|
|
You are correct about the FILE_ATTRIBUTE_DIRECTORY bit. But you had better use the bitwise and (&) operator, do not check for equality, as a directory can be hidden, readonly, etc.
DWORD attrib = GetFileAttributes(szPath);
if (attrib != (DWORD)-1 && attrib & FILE_ATTRIBUTE_DIRECTORY)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Yeah I picked up on that, just after I wrote the post!
Joel Holdsworth
|
|
|
|
|
CFileFind, use IsDirectory()
|
|
|
|
|
bool dirExists
(CString strDirectory)
{
TCHAR* fullPath = _tfullpath (NULL, strDirectory, 0);
if (fullPath == NULL)
return (false);
TCHAR szCurrDir [_MAX_PATH];
_tgetcwd (szCurrDir, _MAX_PATH - 1);
long nStatus = _tchdir (fullPath);
_tchdir (szCurrDir);
free (fullPath);
if (nStatus == 0)
return (true);
return (false);
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
OpenGL is basically the cross platform version of DirectX correct???
OpenGL is somewhat analogous to Window's GDI API in that both provide a drawing context(and functions), OpenGL being tuned somewhat for 3d rendering and taking better advantage of video card capability???
If true, does this mean it's possible to use OpenGL to output text?
If I were writing a game and I wanted it to be cross platform I could write a COpenGL class which basically had a resembelence to MFC's CDC but also API functions for more advanced 3D stuff?
What i'm actually looking to accomplish is to have a CDC but cross platform...i'm not really concerned with 3d rendering for now, but it's a possibility in the future.
I figure, rather than write a cross platform CDC using Linux/Windows GDI API and making things complicated I could just write a high level wrapper interface around OpenGL functions...also this opens up the possibility for 3D rendering in the future.
Is what i'm looking to accomlish possible? Does it make sense?
Just wanted to get your opinion
Cheers
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
OpenGL is basically the cross platform version of DirectX correct???
Sort of. OpenGL is similar to Direct3D. It includes only 3D graphics functionality. No 2D graphics, no audio I/O etc.
Hockey wrote:
OpenGL is somewhat analogous to Window's GDI API in that both provide a drawing context(and functions), OpenGL being tuned somewhat for 3d rendering and taking better advantage of video card capability???
Not really. Yes, it is hardware accelerated, but it is 3D graphics only, as opposed to GDI which is 2D graphics only.
Hockey wrote:
Is what i'm looking to accomlish possible? Does it make sense?
It might be possible, but certainly not easy. OpenGL doesn't have any 2D graphics functionality. It's a purely 3D library. Theoretically, you could probably simulate 2D by applying a bitmap texture to a surface that takes up the entire viewport at a Z-depth of 0, but I'm not sure. You would have to implement all of the 2D graphics operations (lines, circles, fills etc...) in software. Hardware acceleration wouldn't be useful because you wouldn't be using any of the 3D accelerated features (not even texture mapping because your texture would have to be stored in system memory so the appliations could write to it), and I'm fairly sure that graphics cards only apply hardware acceleration to OpenGL when running in full-screen exclusive mode, ie. Only one application can use it at once.
It's a good idea in theory, but I'm just not sure its practical. I'd be happy for you to prove me wrong though
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hmmmm...thanks for the reply...some things I didn't know are now cleared up.
Ryan Binns wrote:
Sort of. OpenGL is similar to Direct3D. It includes only 3D graphics functionality. No 2D graphics, no audio I/O etc.
I was afraid of that.
Ryan Binns wrote:
Theoretically, you could probably simulate 2D by applying a bitmap texture to a surface that takes up the entire viewport at a Z-depth of 0, but I'm not sure.
I'm not sure how you mean...so I would have to (using my custom GDI routines) draw to a bitmap, then apply that bitmap as a texture to a surface?
Ryan Binns wrote:
Hardware acceleration wouldn't be useful because you wouldn't be using any of the 3D accelerated features
If I were rendering 3d objects though, it would make a difference???
There is (after much consideration) a very good chance I will need to render 3d objects as well as 2d.
Cheers
How do I print my voice mail?
|
|
|
|
|
Well openGL came before direct X, and was designed from a different standpoint. (direct X was designed to give you quick access to the video card, openGl to give programers a nice interface to 3d hardware. Latter versions of direct X follow more the open GL model) Text can be done in openGL, but unless you want 3d text that you can look at from different angels it isn't really worth it.
It sounds like you want to use SDL or something like it. SDL is a cross platform video library that a lot of free games are using. It provides 2d and 3d graphics and sound, in the form that games needs. It doesn't have a lot of widgets (buttons and the like) so it isn't so good for normal applications.
A different alternative is to use a cross platform widget set along with openGL. (I have no idea what a CDC is so I'm not sure) QT, gtk, or
|
|
|
|