|
Its easy to do... For example if you have just created a dialog type application you can right click on the dialog and pick Insert ActiveX Control, from here you can pick your ActiveX grid or excel controls.. or from the the menu bar in Visual C++ pick "Project" then "Add to Project" next chose components and controls.. then go to Registered ActiveX Controls folder.
Have Fun!
Rob Jones
|
|
|
|
|
Hi:
I´ve define a dual interface with connection points in VC++, and I want to send data to VB, but I don´t know what have to put in VB to finish the connection. Cuold someone help me? I would grateful if you would send me an example code. Thanks.
|
|
|
|
|
Do you want to say with "finish the connection"?
Carlos Antollini.
|
|
|
|
|
I don´t know the instructions that I have to put in VB to get that the server in VC++ send message to VB, VB catch this msg and display it. Cuold you respond me now?
|
|
|
|
|
CreateObject()
Carlos Antollini.
|
|
|
|
|
Look at the Implements keyword.
Quick pseudo code example to give basic idea.
Implements IConnection
Dim obj as Object
Dim Cookie as Long
private sub Form_Load()
set obj = CreateObject("myapp.object")
Cookie = obj.Advise(Me)
end sub
private sub Form_Unload()
obj.Unadvise(Cookie)
end sub
private sub IConnection_MyConnectionPoint
MsgBox "Called by VC++"
end sub
|
|
|
|
|
Hello,
I'd like to know if it is possible and if so how, to indeed patch a Windows function in order to make all programs use it in standard.
For example, softs that "skin" windows are able to change the default shape of windows. How such things can be achieved ? For example, how would it be possible to have windows with a border of 5 pixels wide instead of the regular 1-pixel ? Or how would it be possible to change the standardclose button image ?
Thank's in advance,
--Francois
|
|
|
|
|
i actually don't know how applications like TALISMAN "skin" windows, but there is a SDK from microsoft called "Detours", which enables you to replace a regular API function with your own. have a look at:
http://research.microsoft.com/sn/detours/
|
|
|
|
|
I have the handle of a window that has been created by an Active X and I want to hook its right click message.
Any idea ?
Thanks
|
|
|
|
|
You need to subclass the window. The topis is too complex to discuss it in detail here. Good starting point is CallWindowProc docs in MSDN. Paul DiLascia created MFC-based solution called CSubclassWnd - it first appeared in June 1997 issue of Microsoft Systems Journal. The article is available in 'Periodicals' section of MSDN.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hello,
I've encountered a CPropertyPage problem that has me very puzzled and
may be a bug. Perhaps someone has seen it and can offer an
explanation and/or solution.
Here's the situation.
Windows SDI app, VC++ 6.0, Windows NT 4.0. I used class wizard to
create the app and used CFormView for the view class. Added a
dialog box and using the dialog editor changed its properties to:
Style: Child, Border: Thin, Title bar, Disabled. I then added
a single Edit Box. Then using class wizard I created a CPropertyPage
class based on this dialog and also created a CPropertySheet class.
Added code to show them.
Everything works as expected, except: You cannot set the focus on
the edit control by clicking on it with the mouse. You can only
set focus to it by using the tab key.
I have a very small project that shows the problem clearly.
If anyone has any insight it would be greatly appreciated.
Dougb
|
|
|
|
|
I am working on an Explorer-type app, and would like to hide the tree view (left side). Note that I don't want to delete or destroy it, since the tree conatins important structural data that I don't want to lose. I've found no examples for thids. Some suggest setting the row width to zero, but the spplitter bar still appears. Any suggestions?
|
|
|
|
|
I'm afraid there's no silver bullet here - you'll have to play tricky. When user switches the tree off, reparent the panes using ::SetParent or CWnd::SetParent, hide the tree and destroy the splitter.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi
I stored two points in an xml file and retrieved them in OnOpenDocument()
but How can I pass these values to View to draw a line with the points?
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
Overide your document's OnOpenDocument() and OnSaveDocument() members.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Hi,
How can i unregister an ActiveX in my computer ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi,
Use regsvr32 with the /u option.
Regards,
Alwin
|
|
|
|
|
Use regsvr32. Call it without parameters to get the usage information.
HTH,
Thomas
I am a signature virus!
Help me spread and copy me to your sig!
|
|
|
|
|
There's also some registry hacks that add register and unregister to the right click menu. They're either on this site or codeguru. If the file is located in "%windows%\downloaded program files" then you can right click on it and select remove.
|
|
|
|
|
Here is how I do it on my machine (for adding right click menu option)
Open your registry using RegEdit (not regedit32)
Find The key HKEY_CLASSES_ROOT\dllfile\Shell
Create a new Key call it RegisterIt
HKEY_CLASSES_ROOT\dllfile\shell\RegisterIt\
in the default string change it to "Lets register this"
Create a subkey call it Command
HKEY_CLASSES_ROOT\dllfile\shell\Register\command
in the default string type the "regsvr32 "%1""
And there you go.
cheers
Alfadhly
It is Illogical to define an inventor by his invention
|
|
|
|
|
I have my Own Method, and I want to share it with all you
First I call AfxOleInit()
Then load the ocx with the function LoadLibrary()
Whit the handle that returns LoadLibrary I call the GetProcAddress() function.
For example:
if(AfxOleInit())
{
HINSTANCE hInst = LoadLiabrary("my.ocx");
if(hInst != NULL)
{
typdef HRESULT (CALLBACK *HCRET) (void);
lpDllReg = (HCRET)GetProcAddress(hInst, "DllRegisterserver"); //or "DllUnRegisterserver"
if(FAILED((*lpDllReg)()))
{
AfxMessageBox("DLLRegisterServer() Failed");
}
}
}
Enjoy!!!!!
Carlos Antollini.
|
|
|
|
|
I have been wondering this many times about various things, in this case I have used ADO:
Why is it that when i use "_ConnectionPtr myPtr" I then can access different member functions depending on if I use dot notation or -> notation......
myPtr-> // Brings up one lot of things in intellisense menu
myPtr. // Brings up different ones
I was wondering why this is the case, as I wouldnt have thought that the second one would do anything after all myPtr is a pointer....
Thanks
|
|
|
|
|
> after all myPtr is a pointer
It's a 'smart pointer'. The smart pointer is an object of the class that overrides the operator-> - in your case it'a _com_ptr_t template.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
myPtr. accesses methods/members of the 'smart_ptr' class used to create the pointer (e.g. CreateInstance)
myPtr-> accesses methods/members of the class type of the pointer
This isn't a great explanation and may not be 100% accurate, but it's how I keep them straight.
>>>-----> MikeO
|
|
|
|
|
Hello,
I have to use 4 charts that plot data incrementally about every 1.5 seconds.I am using MS Chart control
The problem :
The MS Chart Control refreshes everytime i send COleSafeArray to the chart control. This produces an unwanted/undesirable flash while updating. How can i plot to the MS Chart OCX incrementally without having to refresh the entire control everytime a new point is plotted.
Also, i shall be grateful if somebody can guide me with a small piece of code example for doing the same.
This is what i am currently doing(code fragment)
void CChartDlg::UpdateGraph(COleSafeArray saRet1)
{
// Return the safe-array encapsulated in a VARIANT...
m_Chart.SetChartData(saRet1.Detach());
// m_Chart.Refresh();
}
void CChartDlg::OnTimer(UINT nIDEvent)
{
num++;
if (num>=100 || num <0)
num=0;
index[0]=num;
for(index[1]=0; index[1]<2; index[1]++)
{
val = rand()/1000;
// Change to COleVariant
saRet.PutElement(index, COleVariant( val));
}
UpdateGraph(saRet); //Call UpdateGraph function
CDialog::OnTimer(nIDEvent);
}
Thanks in advance
Dashmesh
-------------------------------------------
Dashmesh A. Singh
Tata Consultancy Services,
INDIA
e-mail: visions_next@yahoo.co.uk
dashmesha_singh@tcscal.co.in
|
|
|
|