|
Also...
The title of your post is "How to change place of activex control at run time".
Are you just wanting to change the position/size of the control or create the control at runtime?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I am using version of VC++ version 6.0. I dont understand your concept of wrapper class. The classes gets automatically created once you place activex control.
So I feel version in not required. The defination of create() which I have written is one which comes in Active X controls self generated classes.
Any way I done one mistake I dont need to create
control at runtime. I just need to change place at runtime so that I can save my text display. I got my own answer I have to get window then rect and change place. My current problem is diverted,but still these create remains problem.
#if !defined(AFX_WMPPLAYER4_H__29950495_92A5_48C7_A665_14C10BA68140__INCLUDED_)
#define AFX_WMPPLAYER4_H__29950495_92A5_48C7_A665_14C10BA68140__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
// Dispatch interfaces referenced by this interface
class CWMPControls;
class CWMPSettings;
class CWMPMedia;
class CWMPMediaCollection;
class CWMPPlaylistCollection;
class CWMPNetwork;
class CWMPPlaylist;
class CWMPCdromCollection;
class CWMPClosedCaption;
class CWMPError;
class CWMPDVD;
class CWMPPlayerApplication;
/////////////////////////////////////////////////////////////////////////////
// CWMPPlayer4 wrapper class
class CWMPPlayer4 : public CWnd
{
protected:
DECLARE_DYNCREATE(CWMPPlayer4)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x6bf52a52, 0x394a, 0x11d3, { 0xb1, 0x53, 0x0, 0xc0, 0x4f, 0x79, 0xfa, 0xa6 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }
// Attributes
public:
// Operations
public:
void close();
CString GetUrl();
void SetUrl(LPCTSTR lpszNewValue);
long GetOpenState();
long GetPlayState();
CWMPControls GetControls();
CWMPSettings GetSettings();
CWMPMedia GetCurrentMedia();
void SetCurrentMedia(LPDISPATCH newValue);
CWMPMediaCollection GetMediaCollection();
CWMPPlaylistCollection GetPlaylistCollection();
CString GetVersionInfo();
void launchURL(LPCTSTR bstrURL);
CWMPNetwork GetNetwork();
CWMPPlaylist GetCurrentPlaylist();
void SetCurrentPlaylist(LPDISPATCH newValue);
CWMPCdromCollection GetCdromCollection();
CWMPClosedCaption GetClosedCaption();
BOOL GetIsOnline();
CWMPError GetError();
CString GetStatus();
CWMPDVD GetDvd();
CWMPPlaylist newPlaylist(LPCTSTR bstrName, LPCTSTR bstrURL);
CWMPMedia newMedia(LPCTSTR bstrURL);
BOOL GetEnabled();
void SetEnabled(BOOL bNewValue);
BOOL GetFullScreen();
void SetFullScreen(BOOL bNewValue);
BOOL GetEnableContextMenu();
void SetEnableContextMenu(BOOL bNewValue);
void SetUiMode(LPCTSTR lpszNewValue);
CString GetUiMode();
BOOL GetStretchToFit();
void SetStretchToFit(BOOL bNewValue);
BOOL GetWindowlessVideo();
void SetWindowlessVideo(BOOL bNewValue);
BOOL GetIsRemote();
CWMPPlayerApplication GetPlayerApplication();
void openPlayer(LPCTSTR bstrURL);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WMPPLAYER4_H__29950495_92A5_48C7_A665_14C10BA68140__INCLUDED_)
|| Lust Causes Sorrow ||
|
|
|
|
|
In a dialog, you can add a control variable to the class just like any other control:
// Add the member to the class declaration
CWMPPlayer4 m_MediaPlayer;
...
// Add this line to DoDataExchange() (where IDC_PLAYER is the ID of the control resource)
DDX_Control(pDX, IDC_PLAYER, m_MediaPlayer);
Then any time after the control is created (after the base class OnInitDialog() has been called)
you can access it like any other window (CWMPPlayer4 is a CWnd-derived class)...
m_MediaPlayer.GetWindowRect(...)
m_MediaPlayer.MoveWindow(...)
etc.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi,
Can you please suggest me a way to find out the ID of Back,Finish and Next buttons on the property pages OR to find out the CWnd pointers of those button controls?
With Regards
Neeraj Sinha
|
|
|
|
|
Neeraj Sinha wrote: ID of Back,Finish and Next buttons on the property pag
Back Button : ID_WIZBACK
Next Button : ID_WIZNEXT
Finish Button : ID_WIZFINISH
then you can use GetDlgItem() to do whatever you want. I hope this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
Thnaks a lot.I got my problem solved.
With Regards
Neeraj Sinha
|
|
|
|
|
Neeraj Sinha wrote: Can you please suggest me a way to find out the ID of Back,Finish and Next buttons on the property pages...
How about Spy++?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
Here i will take particual example, please check the screen shot.
http://tinypic.com/4u293qp.jpg
I have got three keys "TestKey", "dontknowkeyname", and "MyRequiredKey", can i know contents about "MyRequiredKey" even if i don't know about the key "dontknowkeyname".
I have got Registry Key Function, so that i can access "TestKey", can i access intermediate "dontknowkeyname" and then "MyRequiredKey".
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language, so please don't mind if i do some grammatical or spelling mistakes in my messages."
|
|
|
|
|
Go recursive!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
If you were looking for information on a known cousin, whose parents you did not know, the best place to start would be all of your grandparent's descendants. Goofy analogy, but it works.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hai..
i need to call ondragenter() from my dialog class ...and i need to set as droptarget as a my dialog class....
how to do....
|
|
|
|
|
|
Also see my reply here[^].
In the sample code I put there, you can add the OnDragEnter()/OnDragLeave() overrides if you need
to respond to those as well.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi everyone,
I am using VC++ 6. I have a 3 listcontrols which display different data. I have customized the list control for the look and feel by creating a class "CCustomListCtrl" .I have created 3 instances of "CCustomListCtrl" in CMainFrame. class which I am using notification message "NM_CLICK" to detect the click on the list. Now i want to identify which of the user has clicked.
|
|
|
|
|
chaitannya_m wrote: Now i want to identify which of the user has clicked.
There is an NMHDR structure that's given as parameter to the function. It contains a variable called hwndFrom which denotes the control from which the notification came. You can use this handle.
|
|
|
|
|
chaitannya_m wrote: class which I am using notification message "NM_CLICK"
Instead of handling the message in the CCustomListCtrl, handle that message in the CMainFrame itself. NM_CLICK is actually a notification. So handle the WM_NOTIFY message in the CMainFrame and check whether the code is NM_CLICK.
|
|
|
|
|
I guess you need to identify the list control which send the NM_CLICK notification message. NM_CLICK notification returns the id and handle to window of list control, this can be used to identify the control.
Best Regards
Raj
|
|
|
|
|
how to use the handle dude...i tried NMHDR ..it does give different values for the list, but how to identify which value is for what. Well i have to use the custom control for sure, its for different purpose. Also i can't use the click notification in the mainframe since i have listcontrols in different windows
|
|
|
|
|
chaitannya_m wrote: how to use the handle dude
I prefer to use ID than handle but no matters.
chaitannya_m wrote: i tried NMHDR ..it does give different values for the list, but how to identify which value is for what.
You need to store the values of ID when the list control is created and matching the value with which the NMHDR returns identifies the list control.
chaitannya_m wrote: Also i can't use the click notification in the mainframe since i have listcontrols in different windows
You can use message handlers in its parent window.
|
|
|
|
|
I have a stand alone application (messenger). I was asked to the messenger to have the fallowing possibility:
from a link with a phone number parameter to make a call in the application. If the messenger is not installed, to take the client to the official web site. If the product is installed to see if it is open. If it is open and the user is logged in to make the call.
My idea is the client to check the registry and see if the product is there, which solves the first part. If there are certain keys in the registry next step is from the processes to see if the product is active. If active somehow send instruction to call the function : CallNumber( phonenumber phnum)
Can you give me any leads on how to do all this, any other solution to the task?
The project is done in C++
Thank you very much
Dimkov Trajce
|
|
|
|
|
|
I am not sure where to post it, but the application is in C++ and I might need coding to make it work with inline commands
|
|
|
|
|
hi all
iam facing link error "unresolved externall symboll" while loading my dll explicitly, but it work i load implicitly, here i given the sample by which i tryed, and i defined all the virtual function in the derived class, which in the base class
#include "stdafx.h"
#include "windows.h"
int main(int argc, char* argv[])
{
typedef UINT (CALLBACK* LPFNDLLFUNC1)(DWORD,UINT);
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
UINT uParam2, uReturnVal;
DWORD dwParam1;
//HMODULE dll_module = LoadLibrary("./../TestDll/Debug/TestDll.dll");
hDLL = LoadLibrary("./../TestDll/Debug/TestDll.dll");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
"MyAbsFunc1");
if (!lpfnDllFunc1)
{
// handle the error
FreeLibrary(hDLL);
return 0;
}
else
{
// call the function
uReturnVal = lpfnDllFunc1(dwParam1, uParam2);
}
}
return 0;
}
can any one help to solve this link error
|
|
|
|
|
you have to specify the lib name in the project setting. or atleat put
#pragma comment(lib, "./../TestDll/Debug/TestDll.lib") in your code.
|
|
|
|
|
Sivakumar R wrote: iam facing link error "unresolved externall symboll"
What's the symbol?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|