Timers and Animation

theForger's Win32 API�̵̳ڶ���(��������)

��ҳ

����
  1. ��ʼѧϰ
  2. һ���򵥵Ĵ���
  3. ������Ϣ
  4. ������Ϣѭ��
  5. ʹ����Դ
  6. �˵���ͼ��
  7. �Ի���
  8. ��ģ̬�Ի���
  9. ��׼�ؼ�
  10. �Ի��򳣼�����
����һ����Ӧ��
  1. ������ʱ�����ؼ�
  2. �ļ��볣�öԻ���
  3. ��������״̬��
  4. ���ĵ�����
ͼ���豸�ӿ�
  1. λͼ���豸������
  2. ͸��λͼ
  3. ��ʱ���붯��
  4. �ı����������ɫ
�������ĵ�
  1. �ο�
  2. ��ѵ�Visual C++�����¸��£�
����
  1. ��������Ľ�Q����
  2. API vs. MFC
  3. ������Դ�ļ���˵��

��������Ľ�Q����

Error LNK2001: unresolved external symbol _main

����һ��δ�����ⲿ���Ŵ�������:һ���ط�������һ���ⲿ������������������������ģ�������������п��ж��Ҳ����������.

����������r����������ԭ�������֮һ. Ҫô����дһ��Win32 GUIӦ��(����һ����console��Ӧ��)���Džs������consoleӦ��������...��������������Ҫ����һ��consoleӦ�õ��]����ȷ��д���DZ���main()����.

����һ����˵��һ����r�Ӷ࣬�������VC++�д�������ʱָ����Win32 Console����������ͻ�õ��������. ��BC++�������й����������ʱ��]��ָ����ȷ��ѡ��ʹ����һ��Win32 GUIӦ�������룬���ͻ���Ĭ�ϵ�consoleӦ�������룬����Ҳ��õ��������.

�޸�����

����������õ�VC++�����´�����Ĺ��̲�ѡ��Win32 Ӧ�ù�������(����Console).

��������õ���BC++�����б�����������-tWѡ��ָ������һ��windowsӦ��.

Error C2440: cannot convert from 'void*' to 'HICON__ *' (or similar)

����������ڱ��뱾�̳��еĴ��룬��ζ��������C++�����ڱ�����.��Щ������Ϊbcc32 ��VC++��C������д�ģ����Բ����ܾ�ȷ����C++���룬��ΪC++������ת�Q�Ĺ�����ϸ�Щ��C++��Ҫ����ʾ��ת�Q��

����VC++(�����������Ҳ������)���Զ���һ��.cpp�ļ���C++���������룬.c���ļ�����C���������룮�����ѽ̳��еĴ������һ��.cpp�ļ�����Ӧ�þ��Ǵ���IJ���ԭ��

��������㲻���ڱ�������̳��еĴ��룬���ҾͲ���ȷ���Ƿ����������п��ܵ�ȷ����һ��Ҫ��Q�Ĵ�����Ҫ���Լ����ж��ܲ���ȫ��������ת�Q������������󣬷���Ļ�������п��ܰ�һ������ת������ת���ĵط���

�޸�����

�����������C���Ͱ����.cpp�ļ���Ϊ.c������.�پ��Ǽ�һ���򵥵ď�ת���̳��еĴ�����C++����Ļ�ֻ��Ҫ����޸�.

�������磬��C����������:

	HBITMAP hbmOldBuffer = SelectObject(hdcBuffer, hbmBuffer);

����C++�о���Ҫһ����ת:

	HBITMAP hbmOldBuffer = (HBITMAP)SelectObject(hdcBuffer, hbmBuffer);

Fatal error RC1015: cannot open include file 'afxres.h'.

�����dz���ֵ��ǣ�VC++����Դ�ļ��м�����afxres.h��������]����MFC�Ĺ�������Ҳ����ˣ���������ļ�ֻ����װ��MFC�Ż���.������Ƶ��ļ������DZ���ģ�����Ҫ����������󣬿�����һ���༭����.rc�ļ����á�winres.h����Q��������afxres.h��������.(ע��Ӧ����������������Ҫ�Q).

Error LNK2001: unresolved external symbol InitCommonControls

������]���������API�������comctl32.lib.����ⲻ��Ĭ�ϼ���ģ�����Ҫô������������мӽ�ȥ��Ҫô��VC++�Ĺ��������е�Link�������м���.

Dialog does not display when certain controls are added

����ListView��TreeView��Hotkey��Progress Bar���ȿؼ�������Ϊͨ�ÿؼ�����Ϊ��������comctl32����windows����Windows95֮ǰ��������.��Button��Edit��ListBox�ȵȿؼ���������Ҳ��ͨ�ã������ǡ�ͨ�ÿؼ�����һ���Ϊ����ʿؼ���.

���������һ��ͨ�ÿؼ����뵽һ���Ի��������ʾ�Ļ����ܿ������������жԻ���֮ǰ����InitCommonControls()ʧ�ܣ������϶���������.����������õĵط���WinMain()�Ŀ�ʼ.��WM_INITDIALOG��̫���ˣ���Ϊ�Ի��������֮ǰ�ʹ���ʧ�ܣ��Ӷ�ʹ����Զ�]�л��ᱻ����.

������Щ�˺��ĵ����ܸ�����InitCommonControls()�Ѿ���ʱ�ˣ���Ӧ�õ���InitCommonControlsEx().������������Ļ�Ҳ�ǿ��Ե�.��InitCommonControls()���Ǽ򵥵���ѣ����]��һ�����.


Copyright © 1998-2008, Brook Miles (forgey). All rights reserved.