|
HEllo, I am want to add some images to the Outlook 2000 using VC++, So that I can inbsert some of them to the emails that I will write. I am a new VC++ programmer.
Please help me tohow to code this and give me suggestions.
Thanks
|
|
|
|
|
where do i validate the dialogs data? Is it in the views member function?
pl give me an idea.
Thanks
dana
|
|
|
|
|
i usually override OnOK in the dialog and do any validation there. if the validation fails, tell the user what happened and then return, don't call CDialog::OnOK.
-c
WWJD? JWRTFM. found on /.
|
|
|
|
|
Ok, I can override the OnOk function to do my validation, but how to i make the users data to be transferred to the dialog's member variable? do i have to call the DoDataExchange function??
|
|
|
|
|
in OnOK, call UpdateData, first. this will send all the data through the DDX functions and into whatever variables you've attached to the controls. then you can look at the member variables and do your other validation.
-c
WWJD? JWRTFM. found on /.
|
|
|
|
|
Validate how ? If you're using DDE, then the data validates itself at the time of entry.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
it is for validating the string entented in the textbox? to my knowledge, i think we can validate only the max. length of the string in DDX functions?
am i correct or not?
|
|
|
|
|
Yes. DDX sucks in any case, you should probably follow Chris' advice and validate in OnOK.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I have implemented global variables with the method that is going round this message board. That is to write a header file with all my global variables and a corresponding .cpp file to call it.
global.h
namespace myspace{
extern int myvar,*myptr;
}
global.cpp
int myspace::myvar,*myspace::myptr;
This work perfectly;), but I need my pointer to be initialize with new() statement for the first use. I would like to put it in the global.cpp file so that this is done automatically when this global file is being used. How do I do that?
Could I do it using Class ?? If the new() statement is implemented in the constructor, would this means every class derive from this Base Class, would call new() statement in the constructor? This means redudant memory allocation is done here?
|
|
|
|
|
There is no class here, only a namespace. You just said they were globals, didn't you ? You can call new in the .cpp file. You could also assign to NULL, and have your classes call new if NULL.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Thanks for the reply.
I will try it out.
Thanks a million!
|
|
|
|
|
do your "new" in your CWinApp's InitInstance.
-c
WWJD? JWRTFM. found on /.
|
|
|
|
|
Declare a class in global.cpp and make a single instance of that class
class CGlobal
{
private:
CGlobal()
{
myptr = new int[32];
}
~CGlobal()
{
delete [] myptr;
}
};
static CGlobal globalInit;
oRion wrote:
If the new() statement is implemented in the constructor, would this means every class derive from this Base Class, would call new() statement in the constructor? This means redudant memory allocation is done here?
Yes. Just don't derive from the class. That can be prevented by making the constructor private.
The other option is to make a GlobalInit() and GlobalCleanup() function which does your allocations and call it at the beginning of your program.
Todd Smith
|
|
|
|
|
Todd Smith wrote:
Declare a class in global.cpp and make a single instance of that class
class CGlobal{private: CGlobal() { myptr = new int[32]; } ~CGlobal() { delete [] myptr; }};static CGlobal globalInit;
Thanks for the reply. I understand the portion on using private for constructor. Could u help tell me more of the statement on
static CGlobal globalInit; ? Where should this be declared in?
Why is there a need to declare it as a static ?
|
|
|
|
|
Hi there,
I have a paradox database ...
I want to open this database by ADO ...
Can i open this database by ODBC driver ?
If yes, i must update my MDAC, is it right ?
I already download MDAC 2.7, can i work with that for opening paradox ?
Please help me !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
If I create an application and use an Access database and a user installs my app on their computer without Access installed, will my application still work...?
Basically is the Access driver a DLL which I can distrubute with my own applications...???
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
To use .mdb databases without Access installed, you'll need so called Jet Engine. It was distributed as part of MDAC stack, but was dropped around MDAC version 2.6. Now you'll need so called Jet 4.0 SP3. Check this MS site for download link:
www.microsoft.com/data[^]
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Thanx i'll check it out...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have a check box button that I create as child of another window at run time. I could not make the checkbox as big as the its window text. it is always bigger that the text. How can I make the check box fit to its text ?
The code I am using is below.
void CParentWindow::PreSubclassWindow()
{
CRect Rect;
GetWindowRect(&Rect);
ScreenToClient(&Rect);
CDC * dc = this->GetDC();
CSize size = dc->GetTextExtent(strCheckBoxCaption);
//Create the check box rectangle
CRect CheckRect (Rect.left + 5, Rect.top , Rect.left + size.cx,
Rect.top + size.cy);
m_Check.Create(strCaption,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_CHECKBOX,
CheckRect,this, 1);
}
Christian Grauss has an article that creates a check box in a static window. But his check box is also bigger than its text.So I could not find an example. How can I fix this ?
Thank you
Orcun Colak
|
|
|
|
|
You want the box and the text to be the same height ? By changing the height of the checkbox ? If you do that, your checkboxes will look different from all the others, for no good reason I can see. Given how simple checkbox functionality is, you could roll your own, but there may be some benefit in some architectures in deriving it from the existing one all the same.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Hi
I just followed the instructions of Erik Thompson's article on how to create deskbands (such like toolbars in InternetExporer or on the taskbar itself).
Ok, everything went fine so far, I could compile my deskband.
By rightclicking on the taskbar I added my deskband to the taskbar. It showed up properly
Now I removed my deskband again because I had to recompile my DLL due to some changes.
But I can't compile it anymore because the file is in use now by the Explorer. However, I removed my bar from the taskbar
So how the hell can I compile my project now?
thanks in advance
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
try to reboot, or kill explorer and re-execute it
and then recompile it.
|
|
|
|
|
Come on, there must be a nicer way to accomplish this. I don't want to reboot before every new compile
modified 12-Sep-18 21:01pm.
|
|
|
|
|
well,
there r some programs that check
what process is keeping a reference
to your dll, and they will kill it.
i am not sure but i think there's an
article somehwere in this site that
explains how to debug shell extension
without killing the process. try looking
out for it.
|
|
|
|
|
and i also want to add to it that
i think there is a registry key
that tells explorer to completly
unload a dll after using it, however
i'm not sure what is it. u should try
looking it up in MSDN!
|
|
|
|