extern "C" const 问题
初学WINDOWS API
extern "C" const IMAGE_DOS_HEADER __ImageBase;
void DumpModule(){
HMODULE hModule = GetModuleHandle(Null);
_tprintf(TEXT("with GetModuleHandle(NULL)= 0x%x\r\n"),hModule);
_tprintf(TEXT("with __ImageBase= 0x%x\r\n"),(HINSTANCE)&__ImageBase);
}
int main(int argc, char* argv[])
{
DumpModule();
return 0;
}
例子编译出错,第一句就有问题,不明白为什么??
C/C++ code:
#include<windows.h>
#include<tchar.h>
#include<stdio.h>
extern "C" const IMAGE_DOS_HEADER __ImageBase;
void DumpModule()
{
HMODULE hModule = GetModuleHandle( NULL );
_tprintf( TEXT( "with GetModuleHandle(NULL)= 0x%x\r\n" ),hModule );
_tprintf( TEXT( "with __ImageBase= 0x%x\r\n" ),( HINSTANCE )&__ImageBase );
}
int main( int argc, char* argv[] )
{
DumpModule();
return 0;
}
If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file).
给GetModuleHandle()传递null 获取calling process的句柄是你的本意吗 你说的出错是这句吗?
__ImageBase在哪定义的
C/C++ code
Code
相关问答:
在查询后将查询出来的值赋给各输入框
<c:if test="${not empty dataValue}">
fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......
为什么C写的DLL文件C、PB能调用VB不能调用?
VB里为什么有的DLL直接通过引用可以使用?有的需要通过declare申明外部函数?这些DLL有什么差别?
1、为什么PB能通过DECLARE声明而VB不行?
2、如果这个dll中的 ......
编写程序detab, 将输入中的制表符替换成适当数目的空格,使空格充满到下一个制表符终止的地方。假设制表符终止位的位置是固定的,比如每隔n列就会出现一个制表符终止位。
------------------- ......
你们现在还在用C吗?C有前途吗?
一定,并永远坚持
引用
一定,并永远坚持
顶
有用。
楼主何出此言
楼主来c版问这个问题是踢馆用意吗哈哈
越来越冷是肯定的,完全淘汰倒也没那么容易
c ......
'\108'作为字符常量对不对?
转义字符'\ddd'表示3位8进制所代表的字符。 但是108不是正确的8进制表示方法,因此应该是错误的。
但是char a='\108'; 为什么编译不出错呢?
\108 没超过 ......