|
Hi
How to send an email using smtp ?
thanx in advance
by
KK
|
|
|
|
|
There are a lot of sources here at CP.
Clickety[^]
|
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
The above class is export in a dll . So should i add new function to the dll ?
Can i have a sample code that achieves it?
class __declspec(dllexport) MyClass
{
public:
static char* LSGDecrypt(const char* key,const char* hex);
static char* LSGEncrypt(const char* key,const char* source);
}
Iam about access a static function
So is that required to instantiate the class object.
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
char* key = new char [50];
key ="KEYVAULE";
char* strPlain = new char [50];
strPlain="password";
char* strResult = new char [50];
DWORD dwrd =NULL;
hDLL = LoadLibrary("Mydll.dll");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,"LSGEncrypt");
if (lpfnDllFunc1 ==NULL) // Fails here? so DLL is freed up?
{
FreeLibrary(hDLL);
}
else
strResult = lpfnDllFunc1("killer" ,"strikes HERE");
}
for thendral
|
|
|
|
|
hi young breeze,
U can use static linking for the dll. so that u don't require to get the function ptr for the LSGEncrypt funtion.
Natpudan,
Parthiban
|
|
|
|
|
Can i have a sample code that achieves it?
class __declspec(dllexport) MyClass
{
public:
static char* LSGDecrypt(const char* key,const char* hex);
static char* LSGEncrypt(const char* key,const char* source);
}
The above class is export in a dll .
So should i add new function to the dll ?
Iam about access a static function
So is that required to instantiate the class object.
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
char* key = new char [50];
key ="KEYVAULE";
char* strPlain = new char [50];
strPlain="password";
char* strResult = new char [50];
DWORD dwrd =NULL;
hDLL = LoadLibrary("Mydll.dll");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,"LSGEncrypt");
if (lpfnDllFunc1 ==NULL) // Fails here? so DLL is freed up?
{
FreeLibrary(hDLL);
}
else
strResult = lpfnDllFunc1("killer" ,"strikes HERE");
}
for thendral
|
|
|
|
|
R.ilan thendral wrote: INSTANCE hDLL; // Handle to DLLLPFNDLLFUNC1 lpfnDllFunc1; // Function pointerchar* key = new char [50];key ="KEYVAULE";char* strPlain = new char [50];strPlain="password";char* strResult = new char [50];DWORD dwrd =NULL;hDLL = LoadLibrary("Mydll.dll");if (hDLL != NULL){lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,"LSGEncrypt");if (lpfnDllFunc1 ==NULL) // Fails here? so DLL is freed up?{FreeLibrary(hDLL); }elsestrResult = lpfnDllFunc1("killer" ,"strikes HERE");}
You can use Exported class this way, because the function have no memory till the Classobject is created.this method is only used to load Dll function.
for loading class from DLL, first you have to create MFC extention DLL,secondly you can try this article...
http://www.codeproject.com/dll/noextensiondll.asp
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
This is Taruni.I am working with MessageBoxes.Is it possible to change the caption "Ok" and set the caption according to our wish on the "OK" and "Cancel" buttons in the MessageBoxes.
-Thanks in Advance
Taruni
|
|
|
|
|
YA its possible.and u can do it dynamically using these calls SetDlgItemText(IDOK, "ABC");
More relaxed the person high is his status.
|
|
|
|
|
Taruni wrote: This is Taruni.I am working with MessageBoxes.Is it possible to change the caption "Ok" and set the caption according to our wish on the "OK" and "Cancel" buttons in the MessageBoxes.
That very tricky task to do. IMHO, you can try this wrapper class instad of normal MessageBox
http://www.codeproject.com/dialog/CPPMessageBox.asp
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello everyone,
I have a tree view consisting of several nodes and when i right click on it a context menu is popped up ,where i enter the required details and preess ok.my code works fine until this.however i need to insert the details in the tree view. when i make a call to
m_PointsTree.GetSelectedItem my application is crashing.Please provide ur suggestion.
HEllo
|
|
|
|
|
Can you show some code segments?
- NS -
|
|
|
|
|
I have two modeless dialog, CDialog1, CDialog2, I use the two dialog in a formview. The formview have a member variable CDialog *m_pDlg;
I use them like this:
CMyForm::CMyForm() : m_pDlg(NULL)<br />
{<br />
}<br />
<br />
void CMyForm::OnDestroy()<br />
{<br />
DestroyDlg();<br />
}<br />
<br />
void CMyForm::DestroyDlg()<br />
{<br />
if (m_pDlg)<br />
{<br />
m_pDlg->DestroyWindow();<br />
delete m_pDlg;<br />
m_pDlg = NULL;<br />
}<br />
}<br />
<br />
short nDlgFlag = -1;<br />
<br />
void CMyForm::OnBtn1()<br />
{<br />
if (nDlgFlag == 0)<br />
return;<br />
<br />
nDlgFlag = 0;<br />
<br />
DestroyDlg();<br />
<br />
m_pDlg = new CDialog1;<br />
m_pDlg->Create(IDD_DIALOG1, this);<br />
m_pDlg->ShowWindow(SW_SHOW);<br />
}<br />
<br />
void CMyForm::OnBtn2()<br />
{<br />
if (nDlgFlag == 1)<br />
return;<br />
<br />
nDlgFlag = 1;<br />
<br />
DestroyDlg();<br />
<br />
m_pDlg = new CDialog2;<br />
m_pDlg->Create(IDD_DIALOG2, this);<br />
m_pDlg->ShowWindow(SW_SHOW);<br />
}
My question is when i click button1 and then button2 the taskmanager show that the appliction used memory increased, but when i minimize it the used memory decreased to lower, and show again the memory used lower than before minimized, I don't know why. Any one help me.
Is there any function can do this but needn't to mimimize it.
Thanks a lot.
Hongjun Ge
|
|
|
|
|
Understanding Windows' memory manager is a daunting task. You can't assume it will behave in a manner which you think is logical. Read here, especially the last section.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I am using visual c++ 6.0,
How can I get automatically the path of my SQL SERVER Database programmatically
I learn my self
|
|
|
|
|
You've not provided enough information to yield a useful answer. For starters, how are you communicating with this database?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
If list control is report style,we can use GetTopIndex() to get the topleft item index,but GetTopIndex() can not be used to list control of icon style.And i want to get the topleft item index, how to implement?
-- modified at 1:42 Friday 21st April, 2006
|
|
|
|
|
try the following. I don't know whether this will work or not. I haven't tried.
to get the index of top left item call HitTest with point as 0,0
int nItem = HitTest( CPoint(0,0));
if( -1 != nItem)
{
// u will get the item index here
}
nave
|
|
|
|
|
|
try this
CPoint pt;
GetItemPosition( 0, &pt );
int nItem = HitTest( pt);
if( -1 != nItem)
{
// u will get the item index here
}
nave
-- modified at 3:52 Friday 21st April, 2006
|
|
|
|
|
|
iterator find(const key_type& k);
const_iterator find(const key_type& k) const;
-- modified at 1:11 Friday 21st April, 2006
|
|
|
|
|
followait wrote: iterator find(const key_type& k);const_iterator find(const key_type& k) const;
There function Signature will be same at compile time!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have tried this in DLL:-
class AFX_EXT_CLASS me
{
public:
int find(const int & k);
const int find(const int & k) const;
};
and funtion signature comes out to be
:-
?find@me@@QBE?BHABH@Z(for non const function) and ?find@me@@QAEHABH@Z for const function
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|