|
Thank you very much for your reply.
But, I also need to modify the previous interfaces.It is basically an MFC Activex control(developed as a reusable component)
Ex: Consider that the control exposes two interfaces,
IExample1 - CSample1
IExample2 - CExample2
Now, There are new requirements that needs to be implemented. Basically, new functionality should be added to CSample1 and CSample2.
If I go for a new interface. The methods of this new interface should use the classes CExample1 and CExample2.
If I change the version and if this OCX is copied to the client machine, what will happen to the previous OCX and if I try to insert the OCX in a new application will there be a distinction between the new version and the old one.
I hope I'm not asking too many questions I would really appreciate any help.
Thanks
|
|
|
|
|
sv14 wrote: But, I also need to modify the previous interfaces
No. Interfaces must not change (It's the first COM commandment) otherwise client applications will be broken.
sv14 wrote: Now, There are new requirements that needs to be implemented. Basically, new functionality should be added to CSample1 and CSample2.
This is good and feasible.
sv14 wrote: If I go for a new interface. The methods of this new interface should use the classes CExample1 and CExample2.
Yes, and you can do it.
sv14 wrote: f I change the version and if this OCX is copied to the client machine, what will happen to the previous OCX and if I try to insert the OCX in a new application will there be a distinction between the new version and the old one.
I think that you should replace the previous version of the OCX with the new one.
Anyway I'm not an expert on COM DLL versioning, try also to ask the COM forum.
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.
[my articles]
|
|
|
|
|
Hi All,
I am developing BHO (Browser Helper Object)in vc++ and till upto date it works fine.But I want to catch the event when any new explorer window is opened ,means if user opens any new explorer window at that time I want catch that event. SO I tried to use DISPID_WINDOWACTIVATE which do not catch this event. I also tried DISPID_NEWWINDOW2 but it catches event only when any new window is generated from the already opened explorer window.
Do you have any idea or any suggetion where I am making mistake??
Thanks in advance.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
U mean u wanna be notified when the user hits Alt + N or opens new explorer window (Not the window opened by Javascript)?
Come online at:-
jubinc@skype
|
|
|
|
|
Thanks for the very quick reply.
Yaa, I want the notification when any new window is opened.( By whatever Atl + N or Ctl + T for new tab window)
Thanks.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
Then the ideal way is, create an Event Object with any Unique name (unique name can be generated using GuidGen) in a worker thread at specified interval of time. Then check its GetLastError() value. If the returned valued is ERROR_ALREADY_EXISTS, means new window has been opened. Open successful creation, remember to close the handle.
Come online at:-
jubinc@skype
|
|
|
|
|
Thanks for replying.
But this not the perfact solution I will have to continuously check for the new window at regular time interval. Is that no other inbiult event that will generate when new window is opened during BHO imlpementation???
I will try your suggetion. If you have any other suggetion then plz reply me.
Thanks.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
There r no such events. The events u r getting, such as BEFORENAVIGATE, NAVIGATIONCOMPLETE, belongs to the Web Browser ActiveX Control. So the Web Browser ActiveX Control doesn't monitor how many instances of it r running.
As far as I know, there's no such feature in IE.
Come online at:-
jubinc@skype
|
|
|
|
|
Sorry for the very late.
May I ask One thing that when DISPID_WINDOWACTIVATE is generated in BHO ?HOw can I catch this event in my application??
Thanks.
Ashish Bhatt,
System Developer,
Avinashi System Pvt. Ltd.
|
|
|
|
|
ashishbhatt wrote: Yaa, I want the notification when any new window is opened.(
Each time IE is opened, doesn't an instance of your BHO also get created?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm new to Visual C++ and am creating a windows form application.
I was wondering if it was possible to link a console application which is written in C but stored in C++ files to a windows form?
So for example if I clicked a button in the Windows Form application then this would run the console application?
|
|
|
|
|
Didn't you ask this question an hour or so ago? If so, this time it makes more sense.
In your onclick event handler, you can use CreateProcess or ShellExecute to run the console program.
Iain.
|
|
|
|
|
Thanks for the reply before you replied I just got the error LNK1152 so not sure if I should try to solve this or use the ShellExecute
|
|
|
|
|
rover_boy wrote: ...I just got the error LNK1152...
Please explain.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have client class written in C saved into C++ files. This class is to connect to a server. I want to use this code which connects to the server in my GUI which is created using windows forms.
I have added Additional Dependencies to the windows form project. The problem is when I include these .cpp code files to the windows form project I get the error LNK1152.
I also get warning messages: "This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use CRT_SECURE_NO_WARNINGS"
I'm looking into ShellExecute to solve my problem
|
|
|
|
|
rover_boy wrote: I get the error LNK1152.
Again, be specific. We're not mind readers.
rover_boy wrote: I'm looking into ShellExecute to solve my problem
Then you will likely need to remove the aforementioned code as it would no longer be needed.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It seems that you need to ShellExecute for run other applications of your program.(anyway you didnt answer to my reply on your previous question ).
|
|
|
|
|
Thanks for the help I might not need to do that if I can solve the error LNK1152
|
|
|
|
|
Did you get this error when you used of ShellExecute?
|
|
|
|
|
Hi all,
On a database I have a table, with two columns, named as FileName and the FileType. On the table I define the data type as 'Text'. I try to add some data to it within my code as follows.
_RecordsetPtr pRec;
ostringstream sqlCmd;
char chState = 'R';
bool bState = true;
if(bState)
chState = 'R';
else
chState = 'T';
sqlCmd << "INSERT INTO tblGroupState(DiskFileName, FileState) VALUES(" << fileName << ", "
<< chState << ")";
try
{
pRec = m_pConn->Execute(sqlCmd.str().c_str(), NULL, adCmdText);
pRec->Close();
}
catch(_com_error &e)
{
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
printf("\n Source : %s \n Description : %s \n",(LPCSTR)bstrSource,(LPCSTR)bstrDescription);
}
Here, m_pConn is the connection to the database and it is perfectly work. Because I used it previously.
My code gives an error, Can you guys find that where I'm going wrong with.
I appreciate your help all the time...
Eranga
|
|
|
|
|
In order to lessen the need for psychic powers, you may want to tell us what the error is, and where it's given?
Iain.
|
|
|
|
|
Yep this is the error.
bstrSource "Microsoft OLE DB Provider for SQL Server" (1)
bstrDescription "The name "G00001_020_01.srf" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted."
I appreciate your help all the time...
Eranga
|
|
|
|
|
So what is G00001_020_01.srf?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
David,
It's the file name I want to add. Actually I found my mistake. That is, I manipulate the sql command in wrong way. Not it is fixed. Thanks for your all help. And sorry for the disturbing on my question.
I appreciate your help all the time...
Eranga
|
|
|
|
|
I am programming in VC++.
I want to enable/disable Local Area Connection.
|
|
|
|