|
Let's say - for a setup-like application; you could pack an unpacker program and the compressed data in an unique file, for easier download. That's easy enough - just "adding" the compressed data at the end of the unpacker exe file.
But .. under Windows NT, you can open an exe file at runtime, using the standard CFile class, read it, and save in a temporary location part of the file; this method doesn't work under Win9x though.
Anybody knows a better way that works under every MS OSes ?
Thanks!
|
|
|
|
|
I am implementing a listview for a touch screen application. I have placed a CSpinButtonCtrl next to the listview to make it easy to scroll, without having to fiddle with the scroll bar. The question is, how do you PERMANENTLY remove the vertical scroll bars from the listview, without settings the no-scroll option in the dialog template editor.
|
|
|
|
|
hi
i... jeims
help me T_T
|
|
|
|
|
Does anybody know, how to play AVI-Files during an application ?
I would like to it with DirectShow, but i would have to Download the whole DirectX SDK (128Mb !!!).
Does anybody know, where i could download only the DirectShow SDK, or any other solution, how to play AVI-Files ?
|
|
|
|
|
Ahh you're making the same mistake I did!!
DirectShow is NOT part of the DirectX toolkit. MS for some unknown reason decided to move it to the DirectX Media SDK which is spearate! I only learn't this after a 128M download! I does actually say this on the web site, but it is not very clear at all. (Us lot over here in England put it download to our lack of ability to read American!)
Anyway why use DirectX? Try a CAnimateCtrl....
|
|
|
|
|
Isn't there any way to create a button(or adding to a menu) in a COM clients dialog through a function of the COM server(dll)
|
|
|
|
|
Isn't there any way to create a button(or adding to a menu) on a server dialog through a function of a COM server(dll)
|
|
|
|
|
Hi,
in my app. i have this code:
The first part loads 2 bitmaps, 1 normal and one inverted one (used as a mask by windows):
HANDLE m_hImage;
HANDLE m_hNegImage;
m_hImage = LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_NORMAL), IMAGE_BITMAP, 0, 0, 0 );
m_hNegImage = LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB__INV), IMAGE_BITMAP, 0, 0, 0 );
Next i create a cursor with the info given:
ICONINFO info;
HCURSOR m_hCursor;
info.fIcon = FALSE; // means it's a cursor
info.xHotspot = 11;
info.yHotspot = 0;
info.hbmColor = (HBITMAP) m_hImage;
info.hbmMask = (HBITMAP) m_hNegImage;
m_hCursor = CreateIconIndirect(&info);
Next i override my OnSetCursor code to do my own implementation:
SetCursor(hCursor)
This code works absolutely fine under WinNT 4.0 but not under Win98. I imagine Win98 can't handle the size (rather big) of my own cursors. Anyway, all the functions return fine and work ok except it displays the standard cursor and not my own creation.
Does anybody have a clue on how i can still use my own images (and thus cursors) in my application under Win98?
Thanks
|
|
|
|
|
How I can get the list of availablis data members of the A class and their type, if there is an object or pointer on the object of the A class? (with C++ means only, w/o programming with assembler)
It is said, it is impossible.
Whether so it?
Thanks.
|
|
|
|
|
How can i display a ctrl in the dropdown window of a combo? for example a button?
or a checklist box?
|
|
|
|
|
Make the Combo box Owner Draw and derive a new class from Ccombobox and the control which u want to add
u also have to override various function (consult MSDN)
|
|
|
|
|
Hi,
I'm using a WebBrowser control inside a CView class. I've
used the ClassWizard to encapsulate the control's functionality,
but although I've used SetWidth() and SetHeight() to set
the right values, I can't get rid of the vertical scrollbar
on the right. SetResizeable(FALSE) returns a funny message,
and none of the CWnd scrollbar functions seem to have any
effect.
Any help will be greatly appreciated.
|
|
|
|
|
This can be done with the IDocHostUIHandler interface that you must implement in your container (CView derived class). Look at GetHostInfo and returning with docHostUIFlagSCROLL_NO flag set.
In ATL support for this interface is built in. You can look at the implementation of CAxHostWindow for an example implementation. A description of some of this can be found in ATL Internals.
|
|
|
|
|
void CDaTestView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_WebBrowserCtrl.SetLeft(0);
m_WebBrowserCtrl.SetTop(0);
m_WebBrowserCtrl.SetWidth(156);
m_WebBrowserCtrl.SetHeight(92);
if(m_WebBrowserCtrl.EnableScrollBar(SB_BOTH, ESB_DISABLE_BOTH) == TRUE)
TRACE("Cannot disable scrollbars!");
m_WebBrowserCtrl.ShowScrollBar(SB_BOTH, FALSE);
// Initialize the first URL.
COleVariant noArg;
m_WebBrowserCtrl.Navigate("file://D:/PROJECTS/MosaicLCD/default.html",&noArg,&noArg,&noArg,&noArg);
LPDISPATCH pDisp = NULL;
IDocHostUIHandler *pHostUIHandler = NULL;
pDisp = m_WebBrowserCtrl.GetDocument();
ASSERT(pDisp);
pDisp->QueryInterface(IID_IDocHostUIHandler, (LPVOID*)&pHostUIHandler);
ASSERT(pHostUIHandler);
if(pHostUIHandler)
{
DOCHOSTUIINFO *pInfo = NULL;
pHostUIHandler->GetHostInfo(pInfo);
if(pInfo)
{
if(((pInfo->dwFlags) & DOCHOSTUIFLAG_SCROLL_NO) == (pInfo->dwFlags))
TRACE("Scrolling enabled");
else
TRACE("Scrolling disabled");
}
}
if(pHostUIHandler)
pHostUIHandler->Release(); // release document's command target
if(pDisp)
pDisp->Release(); // release document's dispatch interface
}
I'm creating the m_WebBrowserCtrl in CDaTestView::OnCreate()
but I get an assertion in the line
pDisp = m_WebBrowserCtrl.GetDocument();
ASSERT(pDisp);
pDisp is NULL! Any idea why? Is there something else wrong
with this code?
Thanks in advance
|
|
|
|
|
You must wait for the DocumentComplete event from the Web browser control before you can get the document. Also you must implement the IDocHostUIHandler interface. The Web browser control will call your GetHostInfo method. You might be able to find some example code for this interface using MFC.
|
|
|
|
|
I want to use a MSchart-like bar-chart or pie-chart in my application . If I use the mschart.ocx in a dialog or a formview ,how can i print it? Or,if there is a easy way to get a method to realize the bar-chart and pie-chart,please tell me!
|
|
|
|
|
I've created container application that contains only one server. How can I make previewing this server from container?
|
|
|
|
|
Hi,
Does anyone know how to create child windows/controls in Visual C++ from an Add-In? I've seen
an add-in that makes Visual C++ look like Visual Basic by adding similar dialog bars, etc.. How can I
do that? Maybe there's COM interface for that?
|
|
|
|
|
Can you give a url to that add-in?
|
|
|
|
|
How can I use the WinInet class to upload files from a local drive to server? If you know, please provide me some sample codes. Thanks.
|
|
|
|
|
Hi,
I have a problem with variable arguments.
I'll try to explain it:
Supposed there is a function, which is prototyped as follows:
int OriginalFunc(int n, ...);
Now I will add some code around this (bought) function like this:
HRESULT EnhancedFunc(sometype somevar, ...)
{
do some enhanced things with somevar;
do some more enhanced things;
// now I call the original function
if(OriginalFunc(?????????))
do some errorhandling;
do some *really* enhanced things
return S_OK;
}
So the question is how to pass a variable argument list through to another function which uses va too?
bye,
rootair
|
|
|
|
|
You can't directly. Instead you must call a version with the va_list arguments.
Its like the use of sprintf and vsprintf . One for this, one for that.
|
|
|
|
|
Thanks for the hint, but I already knew that. Unfortunately there isn't a va_list version of that function...
|
|
|
|
|
Can't you then just prepare the passed-in parameters, so that you pass 'em to the inner function with no ...-arguments?
E.g. the sprintf function can be used to pack all of your parameters into one and then go on.
E.g:
<br />
void myfunc( LPCTSTR param, ... )<br />
{<br />
CString formatted;<br />
<br />
OriginalFunc(formatted);<br />
}<br />
|
|
|
|
|
Hello,
I have an application that I need to use some ActiveX components with.
First let me describe the structure of the application and then the
problem we are having.
The application being developed is an add-on or extension for use with
third party applications. It is contained in a regular MFC DLL so that
it can provide the required "C" type calls for the host application.
Because it also has some user interface components it uses a dialog
based MFC structure to privide these. We used a regular DLL rather
than an extension DLL because the the "host" applications could be
written in any language and with any framework, it is an unknown
factor outside of our control. However, we did want to use MFC
internally.
The CWinApp instance in the DLL starts a modal dialog which acts as
kind of toolbar for the product. In the OnInitDialog method of this
dialog we create several other modeless dialogs for status and data
display.
Now to the problem. If we place an ActiveX component onto any of the
dialogs we get assertions and dialogs fail to create. As a example if
the ActiveX components are placed on the main dialog the debug trace
view shows the following text:
CoCreateInstance of OLE control {50548E24-4550-11D4-A9A7-00400516A5AD}
failed.
>>> Result code: 0x800401f0
>>> Is the control is properly registered?
Warning: CreateDlgControls failed during dialog init.
The error is CO_E_FIRST, Moniker enumeration failure. Whatever that
means.
So, could someone please give us a few pointers here. The InitInstance
method of the CWinAp instance in teh DLL has a call to
AfxEnableControlContainer. what more is required.
The component loads into the test conatiner just fine. It is also
visible and appears correctly in the dialog editor.
Any help or pointers much appreciated,
Thanks
Sid
|
|
|
|