用DLL中的函数在主对话框上,或控件上绘图,输出文字
 


DLL:


// Insert your headers here
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#include <afx.h>//z

#include <windows.h>




#include "stdafx.h"
#include <AFXWIN.H>
#include "WBDLL.h"

#ifdef _DEBUG
#pragma comment(lib, "libcmtd.lib")
#else
#pragma comment(lib, "libcmt.lib")
#endif

#ifdef _X86_
extern "C" { int _afxForceUSRDLL; }
#else
extern "C" { int __afxForceUSRDLL; }
#endif






extern "C" __declspec(dllexport) void DrawLinePP(CDC *pDC,CWnd *pWnd,CPoint pt1,CPoint pt2);



void DrawLinePP(CDC *pDC,CWnd *pWnd,CPoint pt1,CPoint pt2)
{
pDC->MoveTo(pt1);
pDC->LineTo(pt2);
pDC->TextOut(50,50,"2012世界末日",sizeof("2012世界末日")-1);

CString str,str1;
str = "123";
pDC->TextOut(50,70,str);

str1 = "平凡中亦有不平凡!";
pDC->TextOut(80,90,str1);
}


背景透明和红色字


void DrawLinePP(CDC *pDC,CWnd *pWnd,CPoint pt1,CPoint pt2)
{
pDC->MoveTo(pt1);
pDC->LineTo(pt2);
pDC->TextOut(50,50,"2012世界末日",sizeof("2012世界末日")-1);

pDC->SetTextColor(RGB(255,0,0));
pDC->SetBkMode(TRANSPARENT);

CString str,str1;
str = "123";
pDC->TextOut(50,70,str);

str1 = "平凡中亦有不平凡!";
pDC->TextOut(80,90,str1);
pDC->SetTextColor(RGB(0,0,0));
}


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2021-07-12
  • 2021-04-21
  • 2021-10-30
  • 2022-03-02
  • 2021-10-26
  • 2022-01-20
  • 2021-09-30
相关资源
相似解决方案