|
Thilek wrote: when i use C:\Private_Folder\forGetz its not seaching or getting the file name.. unless i use C:\\Private_Folder\\forGetz or C://Private_Folder//forGetz then its working
Because those are string literals, which must contain double backslahes.
Thilek wrote: but when i use folder browser dialog , i will be getting as C:\Private_Folder\forGetz....
Which is correct.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
You must understand the difference between the hardcoded "\\" and thr "\" in the value of the variable.
"\\": is an so calles 'escape sequence' FOR representing the "\" in the string. Look in the values of strings int the debugger
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
its so funny that i been breaking my head for days with this... thanks a lot.. u saved me...
|
|
|
|
|
I am trying to write a simple callback function for my own purpose, not to pass into Windows API as callback arguments. What I did below gets access violation. Where did I do wrong in the below code? Thanks.
typedef void (*fC)(int* p);
bool Test(int n, fC* p)
{
int* pN = new int;
*pN = 3;
(*p)(pN);
delete pN;
return true;
}
void fc(int* p)
{
*p;
}
void main()
{
Test(3, (fC*)&fc);
}
Maxwell Chen
|
|
|
|
|
change
bool Test(int n, fC* p)
to
bool Test(int n, fC p)
Also remove the cast.
void main()
{
Test(3, (fC*) &fc);
}
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Ooops! My bad ...
Maxwell Chen
|
|
|
|
|
|
Maxwell Chen wrote: bool Test(int n, fC* p)
Change to
bool Test(int n, fC p)
Maxwell Chen wrote: Test(3, (fC*)&fc);
Change to
Test(3, fc);
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]
|
|
|
|
|
Thanks!
Maxwell Chen
|
|
|
|
|
I've been looking at callback stuff of my own, and if you your code to:
typedef void (*fC)(int* p);
bool Test(int n, fC p)
{
int* pN = new int;
*pN = 3;
(p)(pN);
delete pN;
return true;
}
void fc(int* p)
{
*p;
}
void main()
{
Test(3, (fC)fc);
}
Then it works just fine...
But your code doesn't look bad to me. Just more indirection than you need. fC is already a type of "pointer to a function", so why make things work with "pointer to a pointer to a function"?
In the interests of science, I added these two lines to main:
fC p0 = fc;
fC *p1 = &fc;
And on the second line I get: "error C2440: 'initializing' : cannot convert from 'void (__cdecl *)(int *)' to 'void (__cdecl ** )(int *)'".
This leads me to suggest that you're seeing the same behaviour as when you try to get a pointer to an array - you get the first element of the array back. This is probably a C thing that's biting you. And then you manually cast it in your original main and things blow up later...
That's my theory, anyway!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Thanks!
Maxwell Chen
|
|
|
|
|
Iain Clarke wrote: In the interests of science
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,
I want to create one email notification application for outlook express 6.
i used "MAPIFindNext()" function to get whether unread messages are present inbox.
this function returns first unread messages id.
but i need to find number of unread messages. Is there any function to find that?
Thanks.
|
|
|
|
|
I'm no great expert, having never used MAPI, but the following line from the documentation may be of help:
MSDN wrote: The MAPIFindNext function allows a client application to enumerate messages of a given type. This function can be called repeatedly to list all messages in the folder.
This implies to me that you can just run the function repeatedly, and just count how often it succeeds - the you have your number!
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Iain,
Yes this function gives notification based on messagetype.
i already tried this...
But consider inbox have three 'x' type messages, call the MAPIFindNext function three time with x messagetype.
it repeats the same message id and not give other message id.
Reason is it's another functionality is, it will give first unread messageid of messagetype 'x'.
am i correct?
Thanks.
|
|
|
|
|
Hai..
Can anyone help me ...
how to get ip address of the system using getadapterinfo function..but I tried using that function but it is not retrving the ip address...
Regards
Sunny G
|
|
|
|
|
And what is retrieving instead? See here [^], for instance.
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]
|
|
|
|
|
optical123 wrote: but I tried using that function but it is not retrving the ip address...
What does your code look like:
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi everyone
Can you give give me a good tutorial about device driver programming,maybe codeproject has articles about make it or using google we can find a lot info about it but I want to start of first,what is device driver and then start to writing code in MFC?
Thanks
|
|
|
|
|
Writing a driver using MFC is like using psychology to get some insight of quantum mechanics .
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]
|
|
|
|
|
Steps:
1: Get a copy of Windows Driver Kit V6001.
2: Install Windows Driver Kit.
3: You get lots of sample code in the hard disk.
BTW, there is no MFC in device driver code.
Maxwell Chen
|
|
|
|
|
Thanks for the info. Can u suggest any tutorials which gives the basic idea of Device Driver Programing...
Thanks
|
|
|
|
|
Look at the Device Driver articles by Toby Opferman[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
brucewayn wrote: Can you give give me a good tutorial about device driver programming...
This is about as good as it gets.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|