Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Peter_J_M__G_
Beginner
54 Views

Linking old C 32bit (from 2000) program

Hello,

you helped me allready to install my new C++ 15 compiler, thanks for that.

Now I compiled and linked an old c program 15 years old.

After 42 linking errors and adding some pragmas I have some DWORD warnings and 2 linking errors now.

guitp.c(1620): warning #810: conversion from "LPSTR={CHAR={char} *}" to "DWORD={unsigned long}" may lose significant bits
                  SendDlgItemMessage(win_handle,101,CB_ADDSTRING,  0 ,(DWORD)(LPSTR)szBuffer);
 gflist.c
gfframe.c
gfmain.c
guitp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_CommDlgExtendedError" in Funktion "WindowProc".
guitp.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_GetOpenFileNameA" in Funktion "WindowProc".
ut:tpwin.exe : fatal error LNK1120: 2 nicht aufgelöste Externe

I think I need an additional pragma?

Many thanks for your help.

Peter

 

0 Kudos
1 Reply
jimdempseyatthecove
Black Belt
54 Views

Peter,

Your calling arguments are incorrect, and have been. The earlier compiler may not have reported this error. In this cases use Google to search for "SendDlgItemMessage" to find the function definition in msdn.

LRESULT WINAPI SendDlgItemMessage(
  _In_ HWND   hDlg,
  _In_ int    nIDDlgItem,
  _In_ UINT   Msg,
  _In_ WPARAM wParam,
  _In_ LPARAM lParam
);

You will see that your last argument, (DWORD)(LPSTR)szBuffer, is in error. You should use (LPARAM)szBuffer.

Jim Dempsey