【发布时间】:2021-01-20 10:01:22
【问题描述】:
我正在使用 C++ MFC 框架。 不幸的是,我遇到了 EndPage() 函数的一些问题。 在调用 EndPage() 函数后,我调试了代码并让该程序失败。我不知道为什么
我把代码sn-p放在下面:
void Druk::DrawECG(short * pointer, int channel_nr, int channelLength)
{
pointer += startSample;
switch (mode)
{
case 1:
int offsets[12];
for (int z = 0; z < 2; z++)
{
StartPage(hDC);
// pointer = 0;
DrawGrid(WYDRUK_I_START_X, WYDRUK_I_START_Y, WYDRUK_I_LIMIT_X, WYDRUK_I_LIMIT_Y, PEN_WIDTH);
DrawScaleVertic(150, 300);
SelectObject(hDC, hFontVertic);
for (int i = 0; i < 12; i++)
{
offsets[i] = WYDRUK_I_OFFSET + i*WYDRUK_I_SPACE;
}
pointer += z*channel_nr*new_sign_len;
//pointer += startSample;
for (int i = 0; i < channel_nr; i++)
{
//pointer = memECG[channels[i]] + startSample;
int current = channels[i];
//new_sign_len = new_sign_len - startSample;
rysujEKG_Vertical(pointer, WYDRUK_I_START_X, WYDRUK_I_LIMIT_X, offsets[current]);
ExtTextOut(hDC, WYDRUK_I_CH_CAPTION_X, offsets[current], NULL, NULL, captions[current], 3, NULL);
pointer += channelLength;
//int diff = channelLength - new_sign_len;
}
DWORD error = GetLastError();
EndPage(hDC);
}
break;
【问题讨论】:
-
我在调用 EndPage() 函数后调试了代码并导致程序失败 -- “程序失败”到底是什么意思?如果有错误,请贴出错误信息、错误号等。
标签: c++ printing mfc windows-ce gdi