本文整理汇总了C++中MakeProcInstance函数的典型用法代码示例。如果您正苦于以下问题:C++ MakeProcInstance函数的具体用法?C++ MakeProcInstance怎么用?C++ MakeProcInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MakeProcInstance函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: com_err_load
void com_err_load(HINSTANCE hInstance)
{
(FARPROC)com_err=MakeProcInstance((FARPROC)com_err_export,hInstance);
(FARPROC)error_message=MakeProcInstance((FARPROC)error_message_export,
hInstance);
(FARPROC)error_table_name=MakeProcInstance((FARPROC)error_table_name_export,
hInstance);
}
示例2: GetNewRegValue
static void GetNewRegValue( HWND hwnd )
{
HWND owner;
DLGPROC fp;
INT_PTR reg_modified;
RegModifyData modify_data;
const char *descript;
unsigned max_descript;
mad_type_info tinfo;
mad_registers *regs;
owner = GetParent( hwnd );
regs = RegListGetMadRegisters( owner );
modify_data.reg_set = RegListGetMadRegSetData( owner );
owner = GetParent( owner );
MADRegSetDisplayGetPiece( modify_data.reg_set, regs, GetDlgCtrlID( hwnd ),
&descript, &max_descript, (const mad_reg_info **) (&( modify_data.curr_info )),
&( modify_data.th ), &( modify_data.maxv ) );
MADTypeInfo( modify_data.curr_info->type, &tinfo );
modify_data.curr_value = alloca( tinfo.b.bits / BITS_PER_BYTE );
BitGet( modify_data.curr_value, (unsigned char *)regs, modify_data.curr_info->bit_start, modify_data.curr_info->bit_size);
MADRegSetDisplayModify( modify_data.reg_set, modify_data.curr_info,
(const mad_modify_list **)( &( modify_data.m_list ) ),
&(modify_data.num_possible) );
switch( modify_data.num_possible ) {
case 2:
if( memcmp( modify_data.curr_value, modify_data.m_list[0].data, tinfo.b.bits / BITS_PER_BYTE ) == 0 ){
memcpy( modify_data.curr_value, modify_data.m_list[1].data, tinfo.b.bits / BITS_PER_BYTE );
}else {
memcpy( modify_data.curr_value, modify_data.m_list[0].data, tinfo.b.bits / BITS_PER_BYTE );
}
reg_modified = 1;
break;
case 1:
fp = (DLGPROC)MakeProcInstance( ChangeRegisterDialog, Instance );
reg_modified = JDialogBoxParam( Instance, "CHANGE_REG_EDIT", owner, fp, (LPARAM)( &modify_data ) );
FreeProcInstance( fp );
break;
default:
fp = (DLGPROC)MakeProcInstance( ChangeRegisterDialog, Instance );
reg_modified = JDialogBoxParam( Instance, "CHANGE_REG_COMBO", owner, fp, (LPARAM)( &modify_data ) );
FreeProcInstance( fp );
}
if( reg_modified == 1 ) {
MADRegUpdateStart( regs, modify_data.curr_info->flags, modify_data.curr_info->bit_start, modify_data.curr_info->bit_size );
BitPut( (unsigned char *)regs, modify_data.curr_info->bit_start, modify_data.curr_value, modify_data.curr_info->bit_size );
MADRegUpdateEnd( regs, modify_data.curr_info->flags, modify_data.curr_info->bit_start, modify_data.curr_info->bit_size );
}
}
示例3: WindowProc
/*
* WindowProc - handle messages for the main application window
*/
LONG FAR PASCAL WindowProc( HWND window_handle, unsigned msg,
UINT wparam, LONG lparam )
/*************************************************************/
{
FARPROC proc;
HANDLE inst_handle;
WORD cmd;
/*
* now process the message
*/
switch( msg ) {
case WM_CREATE:
inst_handle = GET_HINST( window_handle );
break;
case WM_CLOSE:
return( DefWindowProc( window_handle, msg, wparam, lparam ) );
break;
case WM_COMMAND:
cmd = LOWORD( wparam );
switch( cmd ) {
case MENU_ABOUT:
inst_handle = GET_HINST( window_handle );
proc = MakeProcInstance( about_proc, inst_handle );
DialogBox( inst_handle,"AboutBx", window_handle, proc );
FreeProcInstance( proc );
break;
case MENU_EXIT:
SendMessage( window_handle, WM_CLOSE, 0, 0L );
break;
case MENU_CALC:
inst_handle = GET_HINST( window_handle );
proc = MakeProcInstance( inp_setup_proc, inst_handle );
DialogBox( inst_handle, "DATABX", window_handle, proc );
FreeProcInstance( proc );
SendMessage( window_handle, WM_CLOSE, 0, 0L );
break;
}
return 0;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
return( DefWindowProc( window_handle, msg, wparam, lparam ) );
}
return( 0L );
} /* WindowProc */
示例4: DisplayAccel
void DisplayAccel( void )
{
FARPROC fp;
char buf[256];
fp = MakeProcInstance( (FARPROC)GetAccelNameDlgProc, Instance );
DialogBox( Instance, "GET_RES_NAME_DLG" , NULL, (DLGPROC)fp );
FreeProcInstance( fp );
Accel = LoadAccelerators( Instance, accelName );
if( Accel == NULL ) {
sprintf( buf, "Can't Load Accelerator %s", accelName );
Error( "Accelerator", buf );
return;
}
AccelHwnd = CreateWindow(
MENU_CLASS, /* Window class name */
"Accelerator test window",/* Window caption */
WS_OVERLAPPEDWINDOW, /* Window style */
CW_USEDEFAULT, /* Initial X position */
CW_USEDEFAULT, /* Initial Y position */
500, /* Initial X size */
200, /* Initial Y size */
NULL, /* Parent window handle */
NULL, /* Window menu handle */
Instance, /* Program instance handle */
NULL ); /* Create parameters */
if( AccelHwnd == NULL ) return;
ShowWindow( AccelHwnd, SW_SHOW );
UpdateWindow( AccelHwnd );
}
示例5: WREInitResources
Bool WREInitResources( HINSTANCE inst )
{
WREResInfoBrush = CreateSolidBrush( GetSysColor( COLOR_BTNFACE ) );
WREAppInst = inst;
WREResInfoWinProc = (DLGPROC)MakeProcInstance( (FARPROC)WREResInfoProc, inst );
return( WREInitStaticVars() );
}
示例6: WRSelectImage
WRSelectImageInfo * WRAPI WRSelectImage( HWND parent, WRInfo *rinfo, FARPROC hcb )
{
DLGPROC proc;
HINSTANCE inst;
INT_PTR modified;
WRSelectImageInfo *info;
if( rinfo == NULL ) {
return( NULL );
}
info = (WRSelectImageInfo *)MemAlloc( sizeof( WRSelectImageInfo ) );
if( info == NULL ) {
return( NULL );
}
memset( info, 0, sizeof( WRSelectImageInfo ) );
info->hcb = hcb;
info->info = rinfo;
inst = WRGetInstance();
proc = (DLGPROC)MakeProcInstance( (FARPROC)WRSelectImageProc, inst );
modified = JDialogBoxParam( inst, "WRSelectImage", parent, proc, (LPARAM)info );
FreeProcInstance( (FARPROC)proc );
if( modified == -1 || modified == IDCANCEL ) {
MemFree( info );
info = NULL;
}
return( info );
}
示例7: WdeSetCurrentCustControl
Bool WdeSetCurrentCustControl( int which )
{
int ret;
HINSTANCE inst;
FARPROC proc;
if( WdeCustomLibList == NULL ) {
WdeSetStatusByID( -1, WDE_NOCUSTLOADED );
return( TRUE );
}
if( !WDE_CHECK_WHICH( which ) ) {
WdeWriteTrail( "WdeSetCurrentCustControl: bad which!" );
return( FALSE );
}
inst = WdeGetAppInstance();
proc = MakeProcInstance( (FARPROC)WdeSelectCustProc, inst );
if( proc == NULL ) {
WdeWriteTrail( "WdeSetCurrentCustomControl: MakeProcInstance failed!" );
return( FALSE );
}
ret = JDialogBoxParam( inst, "WdeSelectCustom", WdeGetMainWindowHandle(),
(DLGPROC)proc, (LPARAM)(LPVOID)&which );
FreeProcInstance( proc );
/* if the window could not be created return FALSE */
if( ret == -1 ) {
WdeWriteTrail( "WdeSetCurrentCustomControl: Could not create selection window!" );
return( FALSE );
}
return( TRUE );
}
示例8: WREQueryPasteReplace
bool WREQueryPasteReplace( WResID *name, uint_16 type, bool *replace )
{
WREPasteData pdata;
HWND dialog_owner;
DLGPROC proc_inst;
HINSTANCE inst;
INT_PTR ret;
if( name == NULL || type == 0 || replace == NULL ) {
return( FALSE );
}
pdata.ret = 0;
pdata.type = type;
pdata.name = name;
*replace = FALSE;
dialog_owner = WREGetMainWindowHandle();
inst = WREGetAppInstance();
proc_inst = (DLGPROC)MakeProcInstance( (FARPROC)WREResPasteProc, inst );
ret = JDialogBoxParam( inst, "WREPaste", dialog_owner, proc_inst, (LPARAM)&pdata );
FreeProcInstance( (FARPROC)proc_inst );
if( ret == -1 || ret == IDCANCEL ) {
return( FALSE );
}
if( ret == IDM_PASTE_REPLACE ) {
*replace = TRUE;
}
return( TRUE );
}
示例9: EngineOutputPopUp
// front end
void EngineOutputPopUp()
{
FARPROC lpProc;
static int needInit = TRUE;
CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_CHECKED);
if( engineOutputDialog ) {
SendMessage( engineOutputDialog, WM_INITDIALOG, 0, 0 );
if( ! engineOutputDialogUp ) {
ShowWindow(engineOutputDialog, SW_SHOW);
}
}
else {
lpProc = MakeProcInstance( (FARPROC) EngineOutputProc, hInst );
/* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */
CreateDialog( hInst, MAKEINTRESOURCE(DLG_EngineOutput), hwndMain, (DLGPROC)lpProc );
FreeProcInstance(lpProc);
}
// [HGM] displaced to after creation of dialog, to allow initialization of output fields
if( needInit ) {
InitializeEngineOutput();
needInit = FALSE;
}
engineOutputDialogUp = TRUE;
}
示例10: DIALOG_ProgramAttributes
/***********************************************************************
*
* DIALOG_ProgramAttributes
*/
BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
LPSTR lpszWorkDir, LPSTR lpszIconFile,
HICON *lphIcon, INT *lpnIconIndex,
INT *lpnHotKey, INT *lpnCmdShow, INT nSize)
{
CHAR szTmpIconFile[MAX_PATHNAME_LEN];
DLGPROC lpfnDlg = MakeProcInstance(DIALOG_PROGRAM_DlgProc, Globals.hInstance);
INT ret;
ProgramAttributes.nSize = nSize;
ProgramAttributes.lpszTitle = lpszTitle;
ProgramAttributes.lpszCmdLine = lpszCmdLine;
ProgramAttributes.lpszWorkDir = lpszWorkDir;
ProgramAttributes.lpszIconFile = lpszIconFile;
ProgramAttributes.lpnCmdShow = lpnCmdShow;
ProgramAttributes.lpnHotKey = lpnHotKey;
ProgramAttributes.lphIcon = lphIcon;
ProgramAttributes.lpnIconIndex = lpnIconIndex;
#if 0
ProgramAttributes.hTmpIcon = 0;
#else
ProgramAttributes.hTmpIcon = *lphIcon;
#endif
ProgramAttributes.nTmpIconIndex = *lpnIconIndex;
ProgramAttributes.lpszTmpIconFile = szTmpIconFile;
lstrcpyn(ProgramAttributes.lpszTmpIconFile, lpszIconFile, MAX_PATHNAME_LEN);
ret = DialogBox(Globals.hInstance, STRING_PROGRAM,
Globals.hMainWnd, lpfnDlg);
FreeProcInstance(lpfnDlg);
return(ret == IDOK);
}
示例11: TimedMsgBox
int TimedMsgBox(HINSTANCE hInst, HWND hwnd, LPSTR lpText,
LPSTR lpCaption, UINT wBoxType, UINT def_resp, UINT timeoutval)
{
FARPROC lpfnMsgBoxProc;
HGLOBAL hGlob;
LPMSGBOXINFO pBoxInfo;
int retval;
hGlob = GlobalAlloc(GHND,sizeof(MSG_BOX_INFO));
if (hGlob == NULL)
{
return(-1);
}
pBoxInfo = (LPMSGBOXINFO)GlobalLock(hGlob);
pBoxInfo->lptext = lpText;
pBoxInfo->lpcaption = lpCaption;
pBoxInfo->boxtype = wBoxType;
pBoxInfo->defresp = def_resp;
pBoxInfo->timeoutval = timeoutval;
GlobalUnlock(hGlob);
lpfnMsgBoxProc = MakeProcInstance((FARPROC)MsgBoxProc,hInst);
retval = DialogBoxParam(hInst,"TimedMsgBoxDummy",hwnd,(DLGPROC)lpfnMsgBoxProc,(LPARAM)(void FAR *)hGlob);
FreeProcInstance(lpfnMsgBoxProc);
GlobalFree(hGlob);
return(retval);
}
示例12: FileOpen
void FileOpen(HWND hwndOwner)
{
OPENFILENAME ofn;
/* fill in non-variant fields of OPENFILENAME struct. */
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwndOwner;
ofn.lpstrFilter = szFilterSpec;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 1;
ofn.lpstrFile = szFileName;
ofn.nMaxFile = 120;
ofn.lpstrInitialDir = NULL;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 120;
ofn.lpstrTitle = TEXT( "yahoo" );
ofn.lpstrDefExt = TEXT( "TXT" );
ofn.Flags = OFN_ENABLEHOOK;
ofn.lpfnHook = MakeProcInstance(OpenHook, hinstApp);
ofn.lCustData = 0;
ofn.lpTemplateName = 0;
fFirst = TRUE;
GetOpenFileName ((LPOPENFILENAME)&ofn);
FreeProcInstance(ofn.lpfnHook);
}
示例13: BuildFaceList
static void PASCAL BuildFaceList (HWND hDlg, char *FaceName)
/* This function initializes the Font list box with fixed fonts matching
the current charset selection and then selects an item */
{
SendDlgItemMessage (hDlg, ID_FONTSIZE, WM_SETREDRAW, FALSE, 0L);
SendDlgItemMessage (hDlg, ID_FONT, LB_RESETCONTENT, 0, 0L);
{
HDC hDC;
FARPROC ProcInstance;
hDC = GetDC (hDlg);
ProcInstance = MakeProcInstance ((FARPROC)EnumFacesProc,
hEmacsInstance);
EnumFonts (hDC, NULL, ProcInstance, LPDATA(&hDlg));
FreeProcInstance (ProcInstance);
ReleaseDC (hDlg, hDC);
}
SendDlgItemMessage (hDlg, ID_FONT, WM_SETREDRAW, TRUE, 0L);
InvalidateRect (GetDlgItem (hDlg, ID_FONT), NULL, TRUE);
/*-select the same facename as before or default to the first item */
if (SendDlgItemMessage (hDlg, ID_FONT, LB_SELECTSTRING, -1,
(DWORD)FaceName) == LB_ERR) {
SendDlgItemMessage (hDlg, ID_FONT, LB_SETCURSEL, 0, 0L);
}
BuildSizeList (hDlg, &Metrics);
} /* BuildFaceList */
示例14: WdeCreateInfoWindow
bool WdeCreateInfoWindow( HWND main_window, HINSTANCE inst )
{
if( !WdeInitInfoText() ) {
return( FALSE );
}
WdeInfoWinProc = (DLGPROC)MakeProcInstance ( (FARPROC)WdeInfoWndProc, inst );
WdeInfoColor = GetSysColor( COLOR_BTNFACE );
WdeInfoBrush = CreateSolidBrush( WdeInfoColor );
WdeInfoWindow = JCreateDialog( inst, "WdeInfo", main_window, WdeInfoWinProc );
/* if the window could not be created return FALSE */
if ( WdeInfoWindow == NULL ) {
WdeWriteTrail( "WdeCreateInfoWindow: Could not create info window!" );
return( FALSE );
}
WdeInfoWindowDepth = 0;
WdeResizeWindows();
return( TRUE );
}
示例15: EvalGraphPopUp
// creates the eval graph, or unhides it.
VOID EvalGraphPopUp()
{
FARPROC lpProc;
CheckMenuItem(GetMenu(hwndMain), IDM_ShowEvalGraph, MF_CHECKED);
if( evalGraphDialog ) {
SendMessage( evalGraphDialog, WM_INITDIALOG, 0, 0 );
if( ! evalGraphDialogUp ) {
ShowWindow(evalGraphDialog, SW_SHOW);
}
}
else {
crWhite = appData.evalHistColorWhite;
crBlack = appData.evalHistColorBlack;
lpProc = MakeProcInstance( (FARPROC) EvalGraphProc, hInst );
/* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */
CreateDialog( hInst, MAKEINTRESOURCE(DLG_EvalGraph), hwndMain, (DLGPROC)lpProc );
FreeProcInstance(lpProc);
}
evalGraphDialogUp = TRUE;
}