|
How about using WinInet
and stuff like CInternetSession, CHttpFile, CHttpConnection, depending on what you want todo their are several ways of doing this.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
|
It's simple if you're using the MS XML parser:
#import <msxml.dll>
MSXML::IXMLDOMDocumentPtr pDoc;
pDoc.CreateInstance ( __uuidof(MSXML::DOMDocument), NULL,
CLSCTX_INPROC_SERVER );
pDoc->async = VARIANT_FALSE;
pDoc->load ( "http://www.foo.com/path/to/file.xml" ); You'd need to add error handling, of course
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Thanks all very useful info.
Steve
|
|
|
|
|
Hi
Is there any method to view EXE flash macromedia file in a window in my application ? (like avi files)
Thanks very much
|
|
|
|
|
Yes and No, the projector type files are not really designed for this.
However you could include an exe as a resource to your project and then extract out from the PE the swf format, and run it in new ocx. Or even extract the swf at run time from a PE.
It would be easier to extract the swf files beforehand and then use them in your app, whether you include them internally or just load them.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
Thanks very much for your answer
But
is it possible to extract the swf format from the PE ?!?
And How to download the ocx of FLASH Macromedia ?
Thanks very much
|
|
|
|
|
bfadi wrote:
is it possible to extract the swf format from the PE ?!?
I have seen hacker type tools that remove the swf.
Unfortunately I can't find an example online at the moment.
bfadi wrote:
And How to download the ocx of FLASH Macromedia
Check to see you have swflash.ocx already on your PC, most have. Otherwise Macromedia are only to happy to provide it.
Note it is the same ocx that IE uses to run any Flash movie
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
Hi
Thanks very much. I found one program exe2swf
And it work fine.
I found 2 ocx of flash in my computer, on flash.ocx (version6) & swfflas.ocx(version 5)
BUT I get error when trying to insert it in a Dialog
I tried the add registred Active control, but it did not add anyting. Do you have any great idea ?
Thanks very much
|
|
|
|
|
I have always just added the ocx from the menu method as you appear to be doing with no problem
The only thing I can think of, is that maybe you created a Dialog MFC project and did not select ActiveX Support,
I tried it and used the "Shockwave Flash Control". Note: Shockwave and Flash are seperate things.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
Hi,
I am working on an old set of code, where the main program is written in C. It uses a DLL which is statically linked to MFC. Now I want to put a CHTMLCtrl (defined in the DLL, act like a CHTMLVIEW) into the frame window of the C program so that I can view HTML inside the control.
How do I create such a MFC control defined in a DLL in my main C program? How does the message loop works?
Thanks.
--Michelle
|
|
|
|
|
Hi
While creating a owner-drawn menu I have found, that MFT_OWNERDRAW style does not apply to any item with identifier ID_FILE_MRU_FILE1. Here goes my code:
int nItemCount = GetMenuItemCount();
MENUITEMINFO mii;
ZeroMemory(&mii, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_TYPE;
mii.fType = MFT_OWNERDRAW;
for (int i = 0; i < nItemCount; i++)
{
CMyMenu* pMenu = (CMyMenu*)GetSubMenu(i);
if (pMenu)
pMenu->MakeOwnerDrawn();
SetMenuItemInfo(m_hMenu, i, TRUE, &mii);
}
If I use ModifyMenu instead of SetMenuItemInfo, everything is OK, except clicking on items have no effect.
Any suggestions?
Best regards,
v0id
|
|
|
|
|
I have created a toolbar with a number of bitmap buttons. Can anybody tell me the best way to create a pointer to any given button? For example if i declare a CBitmap pointer ( e.g. CBitmap *pBM ) how do I assign something like
pBM = &IDB_BITMAP1?
Thanks...
Ozzy
|
|
|
|
|
CBitmap *pBM = new CBitmap;
pBM->LoadBitmap(IDB_BITMAP1); Don't forget to delete pBM when you've finished with it.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello,
This is a dumb question.. I usually program GUI type apps not console apps.. My question is how do I display a "Press any key to continue" prompt and make the app wait? I'm sure this is probably super easy
Thanks in advance,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Getch();
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi,
Can anybody help me out with an algo for non recursive Traversal of all the items in a Tree Control in MFC?
You people RULE,
Binayak
Binayak
|
|
|
|
|
Hi,
In my program I'm using this recursive function which takes nodes from tree control and adds to the xml document. The first node is created properly, from the second call
HRCALL(pXMLDom->createElement(bstr,&pe),""); //fails
this line fails and generates error (i have checked in the debugger the values of bstr and pe are highlighted).
If I call createElement number of times from the same call of the function it works, but, recursively it fails.
Please help.
void CMfcTree::BuildXML(HTREEITEM hItem, IXMLDOMDocument * pXMLDom, IXMLDOMElement *pRoot)
{
CString strRoot = m_nTree.GetItemText (hItem);
HRESULT hr;
BSTR bstr = NULL;
BSTR bstr_wsn = SysAllocString(L"\n");
BSTR bstr_wsnt= SysAllocString(L"\n\t");
BSTR bstr_wsntt=SysAllocString(L"\n\t\t");
IXMLDOMElement *pe=NULL;
//AddWhiteSpaceToNode(pXMLDom, bstr_wsnt, pRoot);
// Create a <node1> to hold text content.
bstr = strRoot.AllocSysString();//SysAllocString(L"node1");
HRCALL(pXMLDom->createElement(bstr,&pe),""); //fails
SysFreeString(bstr);
bstr=NULL;
bstr=SysAllocString(L"some character data");
HRCALL(pe->put_text(bstr), "");
SysFreeString(bstr);
bstr=NULL;
AfxMessageBox(strRoot);
if (strRoot.Find("Hierarchy")!= -1)
{
//hier
AppendChildToParent(pe, pRoot);
AfxMessageBox("3a");
}
else if (strRoot.Find("Attribute")!= -1)
{
//attribute
/* HTREEITEM hParent = m_nTree.GetParentItem( hItem ) ;
CString parentText = m_nTree.GetItemText(hParent);
AfxMessageBox("3b");
for (IXMLDOMNodePtr tempNode = ptrDocIP->documentElement->firstChild;tempNode != NULL; tempNode = tempNode ->nextSibling)
{
if (parentText.Compare(tempNode->nodeName) == 0)
tempNode->appendChild ( DOMNodePtr[i]);
}*/
}
else if (strRoot.Find("Root")!= -1)
{
AppendChildToParent(pe, pRoot);
AfxMessageBox("3c");
}
// Append <node1> to <root>.
// AppendChildToParent(pe, pRoot);
pe->Release();
pe=NULL;
for ( hItem = m_nTree.GetChildItem( hItem );hItem!=NULL; hItem= m_nTree.GetNextSiblingItem( hItem ))
{
BuildXML (hItem,pXMLDom,pRoot );
}
clean:
;
}
Binayak Bhattacharyya
|
|
|
|
|
If you enter this into HTML code, and run it:
<object classid="clsid:41f17733-b041-4099-a042-b518bb6a408c"
codebase="http://a1540.g.akamai.net/7/1540/52/20030530/qtinstall.info.apple.com/bonnie/us/win/QuickTimeInstaller.exe" width="0" height="0">
It will start the automatic installation of Quicktime, this is the same code that is on their website. Now, How do I make my program's installation do this? I notice that the exe of theirs (the QuicktimeInstaller.exe) has a digital signature, is that all I need?
Please give me some info on this, thanks.
|
|
|
|
|
Hi,
I am looking for a tool to create Bitmaps.
I don't need an elaborate package.
Do you have suggestion?
Claude
|
|
|
|
|
Visual Studio
Microsoft Paint
|
|
|
|
|
Hi,
I want to show tool tips when the mouse is over normal button controls (ie. *not* a toolbar, just on buttons) in my dialog-based app (using the WinAPI with *no MFC*). I have searched here, CodeGuru, Google and MSDN, but all I come up with are ways of doing this in MFC. Does anybody know of a non-MFC way to do this? The only post I found on this gave this code, but I can't get it to work:
// Create a tool tip class and set its parent to the Parent Window
ToolTipWnd = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP, 0,0,0,0, hWnd, NULL, NULL, 0);
if ( ToolTipWnd != NULL )
// Send this message to Activate ToolTips for the window:
SendMessage(ToolTipWnd, TTM_ACTIVATE, TRUE, 0);
// Pass a FALSE when you wish to deactivate the tool tip.
//To assign a tool tip to a control do the following:
TOOLINFO toolinfo; // Tool Tip Info structure
memset(&toolinfo, 0, sizeof(TOOLINFO));
toolinfo.cbSize = sizeof(TOOLINFO);
toolinfo.hwnd = hWnd;
toolinfo.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
toolinfo.uId = IDC_EXEBROWSE;
toolinfo.hinst = NULL;
toolinfo.lpszText = "Select executable"; // Text you wish displayed
SendMessage ( ToolTipWnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfo );
I placed this in WM_INITDIALOG, with no joy. I have tried sending messages via WM_NOTIFY, as you would with a toolbar, like this:
case WM_NOTIFY:
{
//handle tooltip text:
NMHDR FAR *tem=(NMHDR FAR *)lParam;
switch(tem->code)
{
case TTN_NEEDTEXT:
LPTOOLTIPTEXT Tooltip = LPTOOLTIPTEXT(tem);
switch(wParam)
{
case IDC_EXEBROWSE:
Tooltip->lpszText="Select executable";
//............etc...
But all to no avail.
If anybody could tell me a way of getting tool tips working on my button controls using the standard Windows API with no MFC, I would be really grateful.
Many thanks,
KB
|
|
|
|
|
You need to pass all messages being sent to the dialog to the tooltip too, so it can track the mouse position. Send the tooltip ctrl a TTM_RELAYEVENT message in your message loop.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Hi,
Many thanks for your reply, I have been looking into how to use TTM_RELAYEVENT, but unfortunately I couldn't get it to work. I forgot to say in my first post that I'm a novice programmer, so I'm sorry if I'm being slow. This is my callback function as it stands, trying to use TTM_RELAYEVENT and set up tool tips for buttons:
HWND ToolTipWnd;
BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TOOLINFO toolinfo; // Tool Tip Info structure
switch(uMsg)
{
case WM_INITDIALOG:
ToolTipWnd = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP, 0,0,0,0, hWnd, NULL, NULL, 0);
if ( ToolTipWnd != NULL )
SendMessage(ToolTipWnd, TTM_ACTIVATE, TRUE, 0); // Send this message to Activate ToolTips for the window
// Pass a FALSE when you wish to deactivate the tool tip.
//To assign a tool tip to a control do the following:
memset(&toolinfo, 0, sizeof(TOOLINFO));
toolinfo.cbSize = sizeof(TOOLINFO);
toolinfo.hwnd = hWnd;
toolinfo.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
toolinfo.uId = IDC_EXEBROWSE;
toolinfo.hinst = NULL;
toolinfo.lpszText = "test this"; // Text you wish displayed
SendMessage ( ToolTipWnd, TTM_ADDTOOL, 0, (LPARAM)&toolinfo );
return TRUE;
//some code I found to use the TTM_RELAYEVENT, though I've obviously got it wrong...
case WM_MOUSEMOVE:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
{
MSG msg;
HWND hWndTT;
msg.lParam = lParam;
msg.wParam = wParam;
msg.message = uMsg;
msg.hwnd = hWnd;
hWndTT = (HWND)SendMessage(ToolTipWnd, TB_GETTOOLTIPS, 0, 0);
SendMessage(hWndTT, TTM_RELAYEVENT, 0, (LPARAM)(LPMSG)&msg);
//so I also tried this on the off-chance (doesn't work either):
SendDlgItemMessage(hWnd,IDC_EXEBROWSE,TTM_RELAYEVENT,0,0);
break;
}
case WM_COMMAND:
return MainDialog_OnCommand(hWnd, LOWORD(wParam), HIWORD(wParam),(HWND)lParam);
case WM_CLOSE:
EndDialog(hWnd,0);
return TRUE;
}
return FALSE;
}
If you (or anyone) can tell me where I'm going wrong, I'd be really grateful - I'm bound to be doing something very stupid.
Many thanks,
KB
|
|
|
|
|
That's almost right. You don't use TB_GETTOOLTIPS because you're not using a toolbar. You need to save the HWND of the tooltip control when you create it, and send TTM_RELAYEVENT to that window.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|