|
I have put a breakpoint in OnInitDialog and the function is never called ?
AutreChien
|
|
|
|
|
plz check whether ur dialog have any ActiveX controls. Dialog Creation fails if the active-x is not properly registered or didn't load correctly.
nave
|
|
|
|
|
I remove some control and it´s works. Now I have to found why this control is not working, this is a
Custom Control.
Thank you !
AutreChien
|
|
|
|
|
Hi all,
I am developing under winXP. i use a MFC class CComboBox which has 4 items.
in winXP the appearance of the open combobox (which displays the items when i press the arrow)
is ok. but testing it on win2K shows a shrinked arrow with only 1 line of items i can scroll down and up but it doesn't look good
any1 encountered with this problem? what is the solution?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Hi Geniuses,
We have developed an application in VC6.0 to configure a device (with single PCB) thru' serial communication (COM port). Now we need to provide USB interface also. So far I have searched a lot to get the information on handling USB devices in VC++ application. But in vain.
If anyone could guide me to get required information, it would be greatly appreciated.
Thanks in advance,
Sarvan AL
|
|
|
|
|
USB port is not managed the same way as serial port. What you have to do, is open the driver (with CreateFile) that is associated with your device (should have been supplied with the device) and send commands through DeviceIOControl function. All this information should have been supplied also with your device.
In a particular case, it can be used like a standard COM port: it is when you use a USB to serial converter. In that case, the driver will create a virtual COM port that you can open like a standard COM port.
If you provide more information about the device, it would be nice.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi Cedric,
Thanks a lot for your reply.
Let me tell you about the device. It's a box like device with single PCB. As on now, only serial port has been provided. We are not writing the firmware of the device. We are developing only the GUI to configure the device. Hope we need to have the device drivers from the device manufacturer.
Could you tell me few more about DeviceIOControl? It would be more helpful to a newbie, like me.
Thanks once again,
Sarvan AL
|
|
|
|
|
Yes, but this device provide a USB port no ? With this USB port, there must also be a driver supplied in order to use it on your computer. Can you tell me more about that ?
DeviceIOControl[^] but documentation should be supplied with your driver that describes which command to send to the driver.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi Cedric,
I'd like to know that other than device, what are all the things we should get from the USB device manufacturer, like DLL and LIB files, documents, etc.
Since I am new to USB interface, if you could provide still more information, I would be grateful.
Thanks & Regards,
Sarvan AL
|
|
|
|
|
Please provide more information about this USB device. Did you buy it ? Is it something like a development kit ? If yes, you should have received documentation with. Take a look at it, it will provide much information than I can (every device is specific).
But typically, what you should receive is a driver (.sys) and the corresponding INF files (needed for the plug and play) and probably a header file that defines constants to be used with DeviceIOControl.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi Cedric,
The device with USB interface is under development. As the second phase, we going to develop the GUI application with USB interface. The device manufacturer is our client. So we should be able to tell them the required things to provide us for developing the GUI application.
Hope I've explained clearly.
Thanks & Regards,
Sarvan AL
|
|
|
|
|
As far as I know, there should be a driver associated with this device. Maybe you should ask them more information about that.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi Cedric,
As you said, We will ask the client more information about the device, its drivers and required files for PC support.
Thanks a lot for spending your time for me.
Sarvan AL
|
|
|
|
|
Hi
I have a dilog based application, what I want is to print the contents of edit box of dialog.
I know that CPrintDialog pops the print dialog of windows , but not sure how to move further, ( How to print Edit Zox Context.)
So please help me.
Thanks
|
|
|
|
|
|
Hi
Thanks for your reply,
Infact I dont a dialog and want to print Edit Box content without saving it to a file.
Please reply.
Thanks
|
|
|
|
|
<br />
you can use like this(my suggestion)<br />
<br />
PRINTDLG printdlg;<br />
DOCINFO docinfo;<br />
...<br />
...<br />
PrintDlg(&printdlg);<br />
<br />
printdlg.cbSize = sizeof(DOCINFO);<br />
printdlg.lpszDocName = "Job";<br />
printdlg.lpszOutput = NULL;<br />
<br />
StartDoc (printdlg.hDC, &docinfo);<br />
StartPage (printdlg.hDC);<br />
TextOut (printdlg.hDC,10,10,"This is a sample",16);<br />
EndPage (printdlg.hDC);<br />
EndDoc (printdlg.hDC);<br />
<br />
whitesky
|
|
|
|
|
HI googled and studied about printing and now able to print a string buffer.
the code is as follows:
<br />
<br />
void CPrint_DialogDlg::OnPrintReport() <br />
{<br />
char pbuf[100] = "Hello World.";<br />
HDC hdcPrn ;<br />
<br />
CPrintDialog *printDlg =<br />
new CPrintDialog(FALSE, PD_ALLPAGES | PD_RETURNDC, NULL);<br />
<br />
printDlg->m_pd.nMinPage = printDlg->m_pd.nMaxPage = 1;<br />
printDlg->m_pd.nFromPage = printDlg->m_pd.nToPage = 1;<br />
<br />
printDlg->DoModal();<br />
<br />
hdcPrn = printDlg->GetPrinterDC();<br />
if (hdcPrn != NULL)<br />
{<br />
CDC *pDC = new CDC;<br />
pDC->Attach (hdcPrn);
<br />
pDC->StartDoc("test");
<br />
pDC->StartPage();
SetPrintAlign(pDC, hdcPrn);
pDC->TextOut(10, 10, pbuf);
pDC->EndPage();
<br />
pDC->EndDoc();
<br />
pDC->Detach();
delete pDC;<br />
}<br />
<br />
delete printDlg;<br />
}<br />
<br />
<br />
void CPrint_DialogDlg::SetPrintAlign(CDC *pDC, HDC hdcPrn)<br />
{<br />
short cxPage, cyPage;<br />
<br />
cxPage = ::GetDeviceCaps (hdcPrn, HORZRES) ;<br />
cyPage = ::GetDeviceCaps (hdcPrn, VERTRES) ;<br />
pDC->SetMapMode (MM_ISOTROPIC) ;<br />
pDC->SetWindowExt ( 1000, 1000) ;<br />
pDC->SetViewportExt (cxPage / 2, -cyPage / 2) ;<br />
pDC->SetViewportOrg (cxPage / 2, cyPage / 2) ;<br />
pDC->SetTextAlign (TA_BASELINE | TA_CENTER) ;<br />
}<br />
<br />
Now here What I want to ask is that :
How can I handle if buffer content is of more than one page.
Better if provide some code snippet.
Thanks in advance.
|
|
|
|
|
you need to one StartDoc and EndDoc
and use StartPage EndPage for another pages
<br />
StartDoc (pd.hDC, &di);<br />
StartPage (pd.hDC);<br />
TextOut(pd.hDC,10,10,"This is a sample",16);<br />
EndPage (pd.hDC);<br />
StartPage (pd.hDC);<br />
TextOut(pd.hDC,10,10,"This is a sample",16);<br />
EndPage (pd.hDC);<br />
<br />
EndDoc (pd.hDC);<br />
whitesky
|
|
|
|
|
Thanks WhiteSky for your replies.
Now problem that I am facing is:
in TextOut() method if I have to pass a buffer which consists of some new line (\n) and tab ( \t) characters then this prints ||| for these characters.
So please tell me that how can I handle this problem i.e. when I want to print something in new line.
Thanks
|
|
|
|
|
<br />
it worked for me<br />
<br />
CString str="Is this a Test \n 123 \n yes it is \n 456";<br />
StartDoc (pd.hDC, &di);<br />
StartPage (pd.hDC);<br />
DrawText(pd.hDC,str,str.GetLength(),CRect(0,0,1500,350),DT_EXTERNALLEADING);<br />
EndPage (pd.hDC);<br />
EndDoc (pd.hDC);<br />
<br />
whitesky
|
|
|
|
|
I'm using VC6 and I changed my code into unicode, but when I try to debug some function, I find that I can't see the CString any more, it always shows the first character.
So, how can I see the unicode CString when debugging?
|
|
|
|
|
take
tools->option->
in the debug tab u can find a check box Labeled "Display unicode strings"
Check it.
nave
|
|
|
|
|
Hi,
I want to develop application for internet (client /server) which will send file and data to each other on internet.
What are the Programatic problem that can occur while transfer data on internet ?
(means the difference between the application build for local network transfer and one build for Internet data transfer)
What are the steps to be consider to make it efficient and reliable for Internet ?
Thanks
Regards.
|
|
|
|
|
See:
CInternetSession , HINTERNET, InternetOpenURL,InternetReadFile
Cheers
"Peace of mind through Technology"
|
|
|
|