English 中文(简体)
数据类换算问题
原标题:Datatype convertion problems

几天前,i ve在MSYS/Mingw处张贴了执行“快车”问题:

确切的解决办法是,明确装货单。 这样一来,就重新开始尝试采用双赢办法,实施有关这种猎物的 st。 dll的装载工作是罚款:

// Load the RTLCapture context function:
HINSTANCE kernel32 = LoadLibrary("Kernel32.dll");

if(kernel32 != NULL){
   std::cout << "Try to load method from kernel32.dll: CaptureStackBackTrace" << std::endl;

   typedef USHORT (*CaptureStackBackTraceType)(ULONG FramesToSkip, ULONG FramesToCapture, void* BackTrace, ULONG* BackTraceHash);
   CaptureStackBackTraceType func = (CaptureStackBackTraceType) GetProcAddress( kernel32, "RtlCaptureStackBackTrace" );

   if(func==NULL){
       std::cout << "Handle for CaptureStackBackTrace could t loded! Stop demo!."<< std::endl;
       FreeLibrary(kernel32);
       kernel32 = NULL;
       func = NULL;
       exit(1);
   }

   void *array[63];
   int i,num = 0;

   std::cout << "Try to call CaptureStackBackTrace..."<< std::endl;
   num = CaptureStackBackTraceType( 1, 32, array, NULL );}

但是,如果说“CaptureStackBackTraceType”方法,在类型转换问题上操作,就会遇到麻烦:

stacktrace.cpp:138: error: functional cast expression list treated as compound e xpression stacktrace.cpp:138: error: invalid conversion from USHORT (*)(ULONG, ULONG, voi d*, ULONG*) toUSHORT

我认为,这一问题可能是由于MSYS/MinGW与批量定义之间的差别。 明确划定美国水道测量局(USHORT)未签字的短程,没有效果。

Has anyone an idea how i could solve this issue? I would be deeply gratefull for any hint.

Best regards, Christian

最佳回答

在最后一项指令中,你需要使用职能点代码援引该职能。 因此,它应当是num = func( 1, 32, range,NUL );。 否则,你就试图制造一个无名的类别<代码>CaptureStackBackTraceType,并试图将其改为int。 由于换算率确实存在,汇编者正在发放错误。

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签