|
CHYGO wrote: error C2440: '=' : cannot convert from 'void (__cdecl *)(int,int,struct ip_header *,void *)' to 'void (__cdecl *)(void)'
i think i cannot explain more clear than that.
function parameters are not same.
CHYGO wrote: how to solve it?
it depends on your need, may be,
struct nids_prm
{
...
void (*syslog) (int,int,struct ip_header *,void *);
...
}; matches your need.
BTW, a basic C programing book can also solve.
|
|
|
|
|
thx, i need another mothes
i'll try it
|
|
|
|
|
Short answer: this way
struct nids_prm
{
...
void (*syslog) (int , int , struct ip_header *, void *);
...
};
Long answer: use variable number of argument for your functions (and modify accordigly syslog declaration).
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
|
|
|
|
|
thank u
|
|
|
|
|
In nids_prm struct, replace void (*syslog) (); with this: void ( *syslog ) ( int , int , struct ip_header * , void * );
When you declare a function pointer, you have to define exactly the parameters of that function ^^. Enjoy yourself ^^
|
|
|
|
|
i've tried ,and the error is the same
|
|
|
|
|
CHYGO wrote: cannot convert from 'void (__cdecl *)(int,int,struct ip_header *,void *)' to 'void (__cdecl *)(void)'
that's pretty clear, no ?
you're passing parameters to a function which requires none !
|
|
|
|
|
i don't know what's the problem is -_-!
when i drag the .c file into the VC6, the build the default project,then compile ,nothing happen
but when i build a WIN32 or MFC application , the error occur...
|
|
|
|
|
When you build the single .c file, VC6 treats the code as valid C.
The WIN32/MFC app is probably treating the code as C++, which in this case is invalid.
|
|
|
|
|
There are two possible solutions available to you:
1)
void (*syslog)(int, int, ip_header*, void*); 2)
static void my_nids_syslog()
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
error LNK2019: unresolved external symbol _LoadIFilter@12 referenced in function "bool __cdecl CreateIFilter(char *)" (?CreateIFilter@@YA_NPAD@Z)
Here is the code that I wrote:
#include <stdio.h>
#include <windows.h>
#include <locale.h>
#include <filter.h>
#include <filterr.h>
#include <ntquery.h>
bool CreateIFilter(const WCHAR *wcsPath)
{
IFilter *pIFilter = NULL;
HRESULT hr = LoadIFilter(wcsPath, NULL, (void**)&pIFilter);
if (SUCCEEDED(hr))
return true;
else
return false;
}
void DumpProps(char *filename) {
// Translate filename to Unicode.
WCHAR wcFilename[1024];
setlocale( LC_ALL, "" );
int i = mbstowcs(wcFilename, filename, strlen(filename));
setlocale( LC_ALL, "C" );
wcFilename[i] = 0;
if(CreateIFilter(wcFilename))
printf("Ok");
else
printf("False");
}
|
|
|
|
|
definition of the function is missing, easy way is to go to the documentation page of [LoadIFilter^] and check the Requirements section it specifies which library to link, "Import Library: Use ntquery.lib."
|
|
|
|
|
Please, read the posting guidelines at the top of this forum before posting. Use "code block" whenever you need to post code.
From the documentation[^], LoadFilter is defined in ntquery.lib, did you link against that lib file ?
|
|
|
|
|
might be you have to include this line of code in your application :-
#pragma comment(lib,"ntquery.lib")
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Why the CreateIFilter signature of the linker error message doesn't match the one of the code posted?
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
|
|
|
|
|
Hi All,
i Want to know that how can save the List of ListCtrl in MS-Access Database?
please help me fo this ,
i m waiting for ur helpful answers.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
The fact that your data is coming from a list control is irrelevant. The more general question is, "How can I save string data to an Access database?" Goggle should provide you with more than enough information.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i m able to save a Single String in database,
but i have problem in case of ListCtrl because there is a Number of string,
please help me for this.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: but i have problem in case of ListCtrl because there is a Number of string,
The answer is no different whether you are adding one or a hundred strings.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no sir,
actully all others feild in table are having only one string but for two field number of string thats why i have problem.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: actully all others feild in table are having only one string but for two field number of string thats why i have problem.
I left my decoder ring at home. Can you decipher, please?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
bool CreateIFilter(const WCHAR *wcsPath)
{
IFilter *pIFilter = NULL;
HRESULT hr = LoadIFilter(&wcsPath, NULL, (void**)&pIFilter);
// error C2664: 'LoadIFilter' : cannot convert parameter 1 from 'const WCHAR **__w64 ' to 'const WCHAR *'
if (SUCCEEDED(hr))
return true;
else
return false;
}
void DumpProps(char *filename)
{
// Translate filename to Unicode.
WCHAR wcFilename[1024];
setlocale( LC_ALL, "" );
int i = mbstowcs(wcFilename, filename, strlen(filename));
setlocale( LC_ALL, "C" );
wcFilename[i] = 0;
if(CreateIFilter(wcFilename))
printf("Ok");
else
printf("False");
}
|
|
|
|
|
well, the error message is clear: why are passing the address of a pointer where a pointer is expected instead? I.e. Why don't you call the function as follows?
HRESULT hr = LoadIFilter(wcsPath, NULL, (void**)&pIFilter);
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
|
|
|
|
|
oops........ my mistake
thank you.........
|
|
|
|