|
Hi
Suppose we have class that is in a dll, this class has a CString object.
I want to export this class, but I get this warning:
class 'CString' needs to have dll-interface to be used by clients of class
and then I can't access this member of class via my code.
Do you know why?
|
|
|
|
|
|
could i know how can i load active-x control in vc++ at run-time(programmatically).I will be very thankful to you , if you can throw some light on it.
Thanks & Regards,
Praveen A.
praveena@navayuga.co.in.
praveen kumar agarwal.
|
|
|
|
|
Why do you want to load it at run-time, for what reason ?
The purpose of an ActiveX control is not to be loaded at run-time.
You need to have the wrapper classes that are generated when you add the ActiveX to your project. Without these classes, how can you 'communicate' with the control ?
|
|
|
|
|
There are a couple of things worth noting here.
1) you can create a stub class based on an activeX control using VC++'s insert class wizard. This will give you an interface to its methods and properties based on the control's IDL file.
2) Call AfxEnableControlContainer(); (eg in InitInstance or somewhere early on) or nothing good will happen.
) Once you have an instance of the ActiveX stub class class you'll need to call CreateControl on it to instntiate the actual control (note: this may consist of an overridden Create function).
Then you up an running.
Tom
|
|
|
|
|
You make me doubting if I have well understood his question
For me loading the ActiveX at runtime meant that he didn't want to use class Wizard and all these things to add the control to its project but do that at runtime instead.
But we'll probably never know what he wanted to do
|
|
|
|
|
Hmmm... I suppose it depends on what he meant by "load".
I suppose he could have meant trawling through the registry or someone dragging a control onto a page etc.
I just assumed he meant using a control without having first dragged it onto the form design window.
I hope he does respond
Tom
|
|
|
|
|
i meant selecting a control from a list of control without using any wizard. After selection of control just place the same on view window at runtime. even i need to change the control property at runtime as desired by me.
It is like drag and drop control from toolbox on to view window, but instead of runtime samething i want to implement at runtime.
waiting for your reply.
Thanks in advance for the help.
Praveen A.
|
|
|
|
|
Thanks for the reply. yes, I meant adding control at runtime without using class wizard. I want to provide an option to user by which he can load active-x control at runtime and can set the property dynamically.
Thanks & Regards,
Praveen A.
praveen kumar agarwal.
|
|
|
|
|
Hi
Right then...
In order for your app to be able to behave as a container you'll have to have selected Container on the Compound Document Support form when you created your app (or you'll have to set the framework up your self). You'll also have to have a Doc/view architecture but I believe you already mentioned you were using one
One the project is created you'll find a method called OnInsertObject in your view class. If you follow the help files you'll probably be fine from here on, just remember that it's all about the IDispatch interface. If your not sure what that is you'll certainly make your life easier if you look into it.
All the best
Tom
|
|
|
|
|
Hi,
I have 2 questions?
[1] How to create a service application in vc++ ? What are the steps to install this service application and make it run??
[2] How to trap the winlogon events in this service???
A code snippet will be of great help..!!!
Sunil
|
|
|
|
|
sunilpv1982 wrote: [1] How to create a service application in vc++ ?
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
i have one class in which i create
tree view control with it's Create method.
e.g
class CDocTree : CSizingbar
{
public :
CTreeCtrl m_wndTreeCtrl;
};
in this way i am working till now
but i am not able to know when someone right clicks on the
node.
actually i want to do something like this if somebody
right clicks on leaf node then i want to display a popup menu at that position and then on some menu event i wanted to show the dialog box.
in this process i want the label associated with that leaf node..
currently i am catching events in this manner
BEGIN_MESSAGE_MAP(CDocTree, CSizingDocBar)
ON_WM_CREATE()
ON_NOTIFY(NM_DBLCLK,1234,OnTreeNotify)//**
ON_NOTIFY(TVN_KEYDOWN, 1234, OnTreeKeyDown)//**
ON_WM_CONTEXTMENU()
END_MESSAGE_MAP()
how i can achieve it
Thanks and regards
Harshal
|
|
|
|
|
Hi,
Try to
ON_NOTIFY( NM_RCLICK, IDC_TREE, OnRclickOnTree )
in OnRclickOnTree, You can send WM_CONTEXTMENU message.
-----------
Mila
|
|
|
|
|
Check the WM_CONTEXTMENU is called for your tree control.
then check the point where right clicked (lParam value has the point)has any item,.. the handle to the tree will be passed in wParam
if so then check it is leaf node (by checking its child you can find out).
Show your context menu and handle occrdingly..
Hope this'll help...
Do your Duty and Don't expect the Result
|
|
|
|
|
I need to convert a vector to an array. It's no problem really, only one thing bothers me. If i use an iterator to iterate through the vector, i have no counter for the array, unless i declare an extra variable for that. If i use a counter to go through the vector, i bypass the recommended STL-way for iterating - iterators. So, does anyone know any elegant way for that ? I know that it's not really a problem, i'm just trying to optimize my solution.
wbr Mr.Brainley
|
|
|
|
|
A vector 's storage is contiguous, so you can do &my_vector[0] to get an (array-like) pointer to the first element.
|
|
|
|
|
Michael Dunn wrote: A vector's storage is contiguous, so you can do &my_vector[0] to get an (array-like) pointer to the first element.
very encapsulated
|
|
|
|
|
The C++ Standard Library requires that the elements of a vector are in contiguous memory. There's no problem with code like Mike suggested and encapsulation has not been violated as the contiguous storage requirement is documented and required behaviour for a std::vector .
Steve
|
|
|
|
|
Hi
You know we can download all issues of MSDN magazine.
But where can we find recent issues of Microsoft Systems Journal? (http://www.microsoft.com/msj/default.aspx)
I need its recent issues and if you look to the adrees above they are not fully available anywhere.If anyone have recent issues of MSJ,
can please upload anywhere.Or where can i find them.
Thanks
(Sorry if this is wrong forum)
|
|
|
|
|
sawerr wrote: (Sorry if this is wrong forum)
It is, but never mind. MSJ is no more, and hasn't been for some time. Instead, the content was merged with MSDN Magazine.
Steve S
Developer for hire
|
|
|
|
|
sawerr wrote: But where can we find recent issues of Microsoft Systems Journal?
Which one are you interested in?
MSJ merged with MSDN back in 2000 so "recent" is subject to interpretation.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for all answers.
I you looked http://www.microsoft.com/msj/ some articles are still there.Some links are active but 1986-94 articles are not active. In api hooking revealed article http://www.codeproject.com/system/hooksys.asp author gave link of [9] "Load Your 32-bit DLL into Another Process's Address Space Using INJLIB" MSJ May 1994 but i can not reach this article.
If you can provide
Back Issues — 1995-1996
and
Back Issues — 1986-1994
If you can do all of the articles this will be amazing but few of them are also very good for us.
This is perfect for young programmers.MSJ's articles are really profesional.
Thanks for answers again.
If necessary e-mail: sawerr@gmail.com
|
|
|
|
|
sawerr wrote: ...MSJ May 1994 but i can not reach this article.
The source code is available.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am using WNetAddConnection2 to connect to a remote system in the lan.when i am connecting i want it to connect to the remote in the application level but its getting connected in the user level. Is there any way to connect to the remote in the application level.
thank you.
KIRAN PINJARLA
|
|
|
|