Click here to Skip to main content
15,904,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Searching for a Manifest File Pin
_AnsHUMAN_ 20-Oct-08 23:25
_AnsHUMAN_ 20-Oct-08 23:25 
GeneralRe: Searching for a Manifest File Pin
si_6920-Oct-08 23:51
si_6920-Oct-08 23:51 
QuestionAssertion fail error when loading a DLL? Pin
bankey101020-Oct-08 23:10
bankey101020-Oct-08 23:10 
AnswerRe: Assertion fail error when loading a DLL? Pin
Roger Stoltz20-Oct-08 23:22
Roger Stoltz20-Oct-08 23:22 
AnswerRe: Assertion fail error when loading a DLL? Pin
CPallini20-Oct-08 23:25
mveCPallini20-Oct-08 23:25 
QuestionPrinting data to a pdf document using win32 sdk c++ Pin
raesa20-Oct-08 22:53
raesa20-Oct-08 22:53 
AnswerRe: Printing data to a pdf document using win32 sdk c++ Pin
Rajesh R Subramanian20-Oct-08 22:57
professionalRajesh R Subramanian20-Oct-08 22:57 
GeneralRe: Printing data to a pdf document using win32 sdk c++ Pin
raesa21-Oct-08 0:13
raesa21-Oct-08 0:13 
FIrstly, thnx for the reply.I'll explain the problem clearly below:
I have a CAD environtment, UGNX(Unigraphicd NX) and i have a part displayed on the current opened window.I have to capure the contents of the current opened window(i.e., the image of the current opend window) of my UGNX session and put it into a PDF file.This is am trying to do, the file printing option which has PDF complete as one of the printing formats using PrintDLg function in win32 sdk.The result that i am getting is a blank pdf file.I dont seem to undertnd the problem.Can you plse have a look at my code below and tell me where i am going wrong.Plse do reply.

Thnk You.

Sample Code:
HDC GetPrinterDC(HWND hWndParent)
{
PRINTDLG pdlg;

// Initialize the PRINTDLG structure.
memset( &pdlg, 0, sizeof( PRINTDLG ) );
pdlg.lStructSize = sizeof( PRINTDLG );
DEVMODE hDevMode;
// Set the flag to return printer DC.
pdlg.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
pdlg.hwndOwner = hWndParent;
DEVMODE hDmode;
PrintDlg( &pdlg );
// hDC member of the PRINTDLG structure contains
// the printer DC.
return pdlg.hDC;
}

void InitDocStruct( DOCINFO* di, char* docname)
{
// Always zero it before using it.
memset( di, 0, sizeof( DOCINFO ) );
// Fill in the required members.
di->cbSize = sizeof( DOCINFO );
di->lpszDocName = "test";
}


HINSTANCE hInstance;

BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
hInstance = (HINSTANCE)hModule;
return TRUE;
}

extern "C" DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
int nErr = 0;
HWND hWnd = NULL;
HDC hDC;
DOCINFO di;

nErr = UF_initialize();
if (nErr != 0)
{
uc1601 ("Failed to initialise UG session", 1);
return;
}
hWnd = GetActiveWindow();
if (hWnd != NULL)
{
hDC = GetPrinterDC(hWnd);

if( !hDC)
{
MessageBox(NULL, "Error creating DC", "Error",
MB_APPLMODAL | MB_OK );
}

InitDocStruct( &di, "Test");

StartDoc( hDC, &di );

//// Print one page.
StartPage( hDC );

//DrawStuff( hDC );
EndPage( hDC );

//// Indicate end of document.
EndDoc( hDC );

// Clean up
DeleteDC( hDC );
}
nErr = UF_terminate();
}
QuestionMS FLex Grid Usage In MS VS 2005 Pin
dehseth20-Oct-08 22:39
dehseth20-Oct-08 22:39 
AnswerRe: MS FLex Grid Usage In MS VS 2005 Pin
dehseth21-Oct-08 0:57
dehseth21-Oct-08 0:57 
QuestionUpload a file in mfc through HTTP and not FTP Pin
Dhiraj kumar Saini20-Oct-08 22:35
Dhiraj kumar Saini20-Oct-08 22:35 
AnswerRe: Upload a file in mfc Pin
dehseth20-Oct-08 22:45
dehseth20-Oct-08 22:45 
GeneralRe: Upload a file in mfc Pin
Dhiraj kumar Saini20-Oct-08 22:56
Dhiraj kumar Saini20-Oct-08 22:56 
GeneralRe: Upload a file in mfc Pin
Prasann Mayekar20-Oct-08 23:45
Prasann Mayekar20-Oct-08 23:45 
GeneralRe: Upload a file in mfc Pin
Dhiraj kumar Saini20-Oct-08 23:52
Dhiraj kumar Saini20-Oct-08 23:52 
GeneralRe: Upload a file in mfc Pin
Prasann Mayekar21-Oct-08 0:52
Prasann Mayekar21-Oct-08 0:52 
GeneralRe: Upload a file in mfc Pin
Dhiraj kumar Saini21-Oct-08 2:54
Dhiraj kumar Saini21-Oct-08 2:54 
Questionwinhttp issue Pin
George_George20-Oct-08 22:23
George_George20-Oct-08 22:23 
Questionregards MicroSoft visual C++ certification Pin
raju000320-Oct-08 22:03
raju000320-Oct-08 22:03 
AnswerRe: regards MicroSoft visual C++ certification Pin
Rajesh R Subramanian20-Oct-08 22:06
professionalRajesh R Subramanian20-Oct-08 22:06 
GeneralRe: regards MicroSoft visual C++ certification Pin
raju000320-Oct-08 22:15
raju000320-Oct-08 22:15 
RantRe: regards MicroSoft visual C++ certification Pin
Rajesh R Subramanian20-Oct-08 22:25
professionalRajesh R Subramanian20-Oct-08 22:25 
JokeRe: regards MicroSoft visual C++ certification Pin
CPallini20-Oct-08 22:19
mveCPallini20-Oct-08 22:19 
GeneralRe: regards MicroSoft visual C++ certification Pin
Roger Stoltz20-Oct-08 22:25
Roger Stoltz20-Oct-08 22:25 
Question[Message Deleted] Pin
tom4_2520-Oct-08 20:49
tom4_2520-Oct-08 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.