|
Fareed Rizkalla wrote: OPEN_ALWAYS | OPEN_EXISTING
You instruct the CreateFile call to always open an existing file (and NEVER create one). Chances are that the file is deleted and the call to CreateFile is failing.
Also, API calls return a value for a reason - they let you know if something failed. Please check the documentation for these functions and check the return values (you may have to call GetLastError to find out what exactly went wrong).
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hy.Have anybody know a CSMTP client class , or an tutorial about to how to construct that ?
|
|
|
|
|
Jakub Piwowarczyk has written an interesting codeproject article with a class named CSMTP. The link to it is below.
SMTP Client[^]
...
|
|
|
|
|
Thanks , I try it , but do not send attach file ( attach file size is 0 ).
modified on Saturday, May 1, 2010 1:54 PM
|
|
|
|
|
Ok, you wrote that the program worked, you got no errors, an email was sent but not the attachment. ( attached file size is 0 ).
If you have problems sending an email, use Visual Studio's debugger and analyse the conversation
between your SMTP server and the client; perhaps, your server needs a different kind of authentication or doesn't need it at all.
|
|
|
|
|
You might have right , for test I use my gmail count , smtp.gmail.com , I will work around ... thanks .
|
|
|
|
|
I am having a tree on a dialog. I can select a node by clicking it; it highlights that node. But when I click in the textbox (or any other control in the dialog) then the selected node of tree does not remain in highlight state. It looks like nobody has clicked on any node. But when I click back on TreeCtrl then the selected node again get highlight.
So how to preserve the highlighted state or how to change selected node's backColor while I click on any other node and leave tree.
Thanks,
Rahul
|
|
|
|
|
|
Thanks Gary that worked. But backcolor is light Gray. So how can I change it to light blue.
|
|
|
|
|
These are the standard Windows colors. In order to override the colors in your control, you will probably need to implement custom drawing[^], which can be a little involved.
|
|
|
|
|
When I try to put WaitForSingleObject in the main dialog of a program using visual studio c++ 6.0 I get a c0239 error: WaitForSingleObject: is not a member of global namespace, yet WaitForSingleObject pops up in the window of available member variables and functions when I type "::", and I am using WaitForSingleObject in several threads that are started by the main Dialog and exist in separate files. I made sure all the #includes matched in the different files. Does anybody know what is going on?
|
|
|
|
|
Gregory Hartmann wrote: I made sure all the #includes matched in the different files
Are you sure Windows.h is included?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I did try including Windows.h in the GUI dialog but I still received the same error.
|
|
|
|
|
void earth(float ihl[][], int go[][])
{
}
I found these not working. How to pass these two dimensional arrays into a function?
Thanks
|
|
|
|
|
You could do this -
void earth(float** ihl, int** go)
{
}
|
|
|
|
|
the two parameters of two dimensional arrays are from input. I need to pass them to the function to process. After the process I do not need them. So after the function call, I delete these two arrays.
Do you think I can pass them in a better way ?
Thanks
|
|
|
|
|
mrby123 wrote: So after the function call, I delete these two arrays.
Only if you used new (or malloc() ) to create them. Otherwise, there's nothing to delete.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
You are right. I used "new" created these variables before calling the function, I am planning to delete them after the function call.
Now I need a good way to pass these 2D arrays to the function
Thanks
|
|
|
|
|
mrby123 wrote:
Now I need a good way to pass these 2D arrays to the function
What's wrong with:
float **ihl;
int **go;
earth(ihl, go);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
My 2D arrays are read from input files. I need to pass these data to the function to process.
Thanks
|
|
|
|
|
If the array bounds are fixed then you may safely use them, for instance:
int fun(int a[3][5])
{
}
in the other hand, if the array bounds may vary then you need to pass them to the function, fo instance (this may depend on how do you allocated the array)
int fun(int * a, int m, int n)
{
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Hi,
These are compiled code to pass two dimensional arrays in a function and how to call the function.
1. function definition:
void CCib_procDlg::de_time(float **delms,float **sds,float **delmih,float **sdih
,unsigned int nlinks[])
{ ......}
2. declared in the header file .h file:
void CCib_procDlg::de_time(float**,float**,float**,float**,unsigned int[]);
3. called in the main program:
......
de_time(delms,sds,delmih,sdih,nlinks);
......
Please check my code and make comments. Thanks for the help
|
|
|
|
|
if de_time function doesn't know in advance the array bounds then your code is bad.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How to make it know the vound of the arraies ? thanks.
I need to declare the function in the header file. I do not know how to declare it ?
|
|
|
|