|
Hi,
Can anyone tell me (or give me a link) how to print a CString?
I'm looking into CPrintDialog, but nothing happens so I must be forgetting something.
tnx a lot 4 your help.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Havr you tried even looking in the printing section here at CP?
I have posted a complete example on printing a long CString....using MFC
If you vote me down, my score will only get lower
|
|
|
|
|
tnx it worked, but I put myself into new trouble by converting the string to rtf format. I could change the \par and \tab to \n and \t, but I also need bold and underlined text.
I know FORMATRANGE will do this automatically, but how to add a CString to a CHARRANGE?
(ps: I did search for print functions before I asked here at the forum, but your article didn't show up until I committed your name. Just so wouldn't think I asked first and searched later )
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi Guys,
How r u all. I want to display a Meta File, But part of it.
I tried it by using playMetaFile() function.
This function is displaying whole meta file.
I would like to display only part of it
Like half of file to last of file.
Thanks in advance.
Salman
If you have in the cause and in the means and in the GOD, hot sun will be cool for you.
|
|
|
|
|
Hello,
Here is a problem for the realy good programer.
Well I need to check if someone start a download on a computer is there anyone how can help me, I need help fast.
\Never feer thare is always someone out there....
|
|
|
|
|
Hi,
I am currently writing an MFC dialog-based app which displays a html file using an Internet Explorer ActiveX control (i.e. Microsoft Webbrowser ActiveX Control), which works fine.
You can print a html-file from that control by right-clicking on the control and selecting "Print" from the Context Menu. However, I'd like to have a button in my dialog to print. So I searched through the generated Wrapper-Class of CWebBrowser2, but unfortunately, there is no function to call the printing routine. So, do you have any suggestion how I can print a html file using the Webbrowser ActiveX control?
Thank you very much in advance,
Erik
|
|
|
|
|
Hi,
I need a 'find method' which returns a node in a IXMLDOMDocument.
Is there any easy way to achieve this? Any tutorials/links about this?
Thanks in advance,
Jens
|
|
|
|
|
You could try here Code Project[^]
Or use the CP site search and look for "XML Document Wrapper" for instance.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi Antony,
I have used that wrapper class you suggested already. It had a 'find' function in it, but it's pretty strangely coded that part.
When he finds it, he adds it to the root node. Not exactly what i wanted to do with it. It should return a CXMLNode* or NULL if not found.
|
|
|
|
|
It was quite a while ago that I looked at that class, I just remembered that there was a Find implementation.
If it generally finds a node then you ought to be able to change the function to return CXMLNode*.
CXMLNode* CXMLNode::Find(CXMLNode* rootNode, LPCTSTR nodeName, LPCTSTR nodeText, LPCTSTR attribName, LPCTSTR attribValue)
Where it adds the node to the root replace
CXMLNode *pNode = new CXMLNode(Nodes[i]);
rootNode->Nodes.Add(pNode);
with
return Nodes[i];
And right at the end of the function
Nodes[i]->Find(rootNode,nodeName,nodeText,attribName,attribValue);
}
return NULL;
}
For your purposes you will probably not need to pass rootNode to the function and therefore all refrences to it can be removed.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
JensB wrote:
I need a 'find method' which returns a node in a IXMLDOMDocument
Yes. SelectNodes() and SelectSingleNode() returns nodes matching an XPath statement.
JensB wrote:
Any tutorials/links about this?
Tons. Try some of the sites listed at the bottom of this page. Also try GOOGLE: XML XPath tutorial reference
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi.
Is it easy to integrate XPath functions into regular XML files?
selectNodes() is not a member function of IXMLDocument for example
|
|
|
|
|
JensB wrote:
Is it easy to integrate XPath functions into regular XML files?
I don't know what you mean. If you are using any parser that supports XPath queries ( MSXML does ) then it is integrated for you. You construct the XPath statement through whatever means is required to solve the current problem. You provide the statement as a text string to the parser engine (with MSXML it is the IXMLDOMDocument::SelectNodes() and SelectSingleNodes() methods) and it returns a node list of all nodes matching the XPath statement.
JensB wrote:
selectNodes() is not a member function of IXMLDocument for example
It is a member of IXMLDOMDocument. It inherits that method as well as selectSingleNode() from the IXMLDOMNode interface. That allows you to execute relative XPath statements.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmmthselectnodes.asp[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Yes. This is verry handy and works great. I wasn't aware of the existence of 'XPath'.
Thanks alot for the excellent help.
Greetings,
Jens
|
|
|
|
|
Hello,
How does one do about rebuilding Classwizard's data/info?
I have just created some projects from scratch by adding the appropriate source files to them but, unfortunately, I seem to have lost all Classwizard data. Not that it matters the world, but ClassWizard is indeed handy.
Is there anything I can do to (re)solve this?
Thanks,
David
|
|
|
|
|
Delete the .CLW file from your project directory and then class wizard will rebuild the information the next time you run the class-wizard.
Michael
CP Blog [^]
|
|
|
|
|
Hi there,
The problem is I didn't even have a .CLW file. I just added the source files I needed in to a blank static-lib project hoping that ClassWizard would then be available... but no chance! The menu item is even disabled.
What should I do now?
|
|
|
|
|
ClassWizard is a MFC facility. I'm not sure if class-wizard is supported in a static-lib, even if you set-up the lib to use MFC. I only have one static lib that uses MFC and I can't see any options to enable class-wizard for it.
Michael
CP Blog [^]
|
|
|
|
|
Hai all,
I am doing an application VC++ 6.0 MFC.
In my application, I have to add folders in the TreeView Control.
The folders are physically present in a system directory.
If i choose a folder from the Treeview, the contents of the folder
should be displayed in a ListView Control.
how can i place a physical folder in a ListView Control and navigate through it?
please help me.
With thanks and regards
Arun Chakaravarthy.
|
|
|
|
|
I hope this will help you,
The ListView sample demonstrates the extended ListView styles and item indenting.
File: ListView.c
HANDLE g_hInst;
TCHAR szClassName[] = TEXT("ListViewClass");
BOOL g_bCustomDraw;
#define IDC_LISTVIEW 1000
WinMain
int PASCAL WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
INITCOMMONCONTROLSEX iccex;
//required to use the common controls
iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
iccex.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&iccex);
g_hInst = hInstance;
if(!hPrevInstance)
if(!InitApplication(hInstance))
return FALSE;
/* Perform initializations that apply to a specific instance */
if (!InitInstance(hInstance, nCmdShow))
return FALSE;
/* Acquire and dispatch messages until a WM_QUIT uMessage is received. */
while(GetMessage(&msg, NULL, 0x00, 0x00))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
/******************************************************************************
MainWndProc
******************************************************************************/
LRESULT CALLBACK MainWndProc( HWND hWnd,
UINT uMessage,
WPARAM wParam,
LPARAM lParam)
{
switch (uMessage)
{
case WM_CREATE:
{
HWND hwndListView;
g_bCustomDraw = FALSE;
// create the TreeView control
hwndListView = CreateListView(g_hInst, hWnd);
//initialize the TreeView control
InitListView(hwndListView);
}
break;
case WM_NOTIFY:
return ListViewNotify(hWnd, lParam);
case WM_SIZE:
ResizeListView(GetDlgItem(hWnd, IDC_LISTVIEW), hWnd);
break;
case WM_INITMENUPOPUP:
UpdateMenu(GetDlgItem(hWnd, IDC_LISTVIEW), GetMenu(hWnd));
break;
case WM_CONTEXTMENU:
if(HandleContextMenu(hWnd, wParam, lParam))
return FALSE;
break;
case WM_COMMAND:
return HandleCommand(hWnd, wParam, lParam);
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
break;
}
return DefWindowProc(hWnd, uMessage, wParam, lParam);
}
/******************************************************************************
AboutDlgProc
******************************************************************************/
BOOL CALLBACK AboutDlgProc( HWND hDlg,
UINT uMessage,
WPARAM wParam,
LPARAM lParam)
{
switch (uMessage)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDOK:
EndDialog(hDlg, IDOK);
break;
case IDCANCEL:
EndDialog(hDlg, IDOK);
break;
}
return TRUE;
}
return FALSE;
}
IF you need further details visit microsoft.com ListViewControl
|
|
|
|
|
Hi everybody,
I need to write a kind of scheduler program in MFC. As far as I know there is a SeTTimer
funtion but it only gives me periodic ON_TIMER message which is not a proper way to alert the program ,for example, at 03.agu.2004 16:30:00.
Please guide me.
Thanks,
Muharrem
|
|
|
|
|
here is you r solution buddy
,just check the current time every time the WM_TIMER message Generate.
like this way
CTime tm=CTime::GetCurentTime();
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Don't you think It is not necessary to check every ,let say, one second if
time has alredy expired or not. I assume there should be some way shorter and smarter
to set a kind of timer for an absolute time. But I don't know how?
Any way thanks for your reply.
Muharrem
|
|
|
|
|
This sounds like a job for the ITaskScheduler interface. See also the ITask and ITaskTrigger interfaces.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am just starting with C++, and have a problem. I wrote a text game but the thing is some times I want the new question etc to start at the top of a clean black screen (that is erase all previous lines).
I could just put a pile of endl; but a couple of days ago somewhere on the site I saw a clrScrn; statment or something like that and remembered BASIC.
Could someone tell me the the #include and the correct way to use it.
Thanks in advance!
|
|
|
|