|
Yes, as I said earlier a class method is similar as a global method (so, there is one single function even if there are mutliple instances of the class or even no instance at all). When the method is called, the address of the instance on which the function is called is passed to the function (the 'this' pointer). This means that as long as you don't access any variables of the class, you can perfectly call the function even if the instance is NULL.
|
|
|
|
|
There is one exception: if the function call is indierect because of a v-table (the method is virtual), even if the function itself don't refer the this pointer, a valid this is required to perform the runtime redirection.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Yes, I forgot that.
Mmmh, let's say I didn't want to confuse the OP with too much information
|
|
|
|
|
Cedric Moonen wrote: I didn't want to confuse the OP with too much information
But what about me? I am still trying to absorb this.
It's time for a new signature.
|
|
|
|
|
Err, what do you mean exactly ? I don't get it...
|
|
|
|
|
I mean I was confused by this thread, but now I'm beginning to understand, thanks to your comments.
It's time for a new signature.
|
|
|
|
|
There is difference between "global function" and "class member function" only when the latter refers to the object's "this pointer". If not, these two functions are the same.
In your situation, the "(*s).func1();" doesn't refer to "this pointer". So it behaves just like a "global function". It doesn't use "this pointer" which is NULL here, hence no error there.
|
|
|
|
|
Hi,
I am creating a setup & deployment project in Visual Studio 2008 (VC++). I need to install a driver while running installer.msi . I have the command line for installing the driver below
devcon -r install driverx.inf *driverx.sys
How to include the above exe in Setup and Deployment project? I tried custom action and specified parameters "-r install driverx.inf *driverx.sys". But during installation I am getting the error message "THere is a problem with this windows installer package. A program run as par of the project did not finish as exepected .."
How to configure Setup and Deployment project for executing above exe?
|
|
|
|
|
I'm not familiar with "setup&deployment" project, but know something about it in "InstallShield".
In "InstallShield", there is a place you can setup "support files". These files will be copy to temporary folder when your install program is running. Then you can use script language to execute the command line.
If there is a same place in "setup&deployment" project, you can add "devcon.exe" to the "support files", then use script language to run it.
Is the above useful for you?
|
|
|
|
|
Thank you very much. But I am still trying to find a way to install driver via Setup & Deployment Project. If nothing works out I will consider InstallShield.
|
|
|
|
|
Hi Forums
I am try to open Excel Protected workbook.I know how to open excel through microsoft office automation.
Excel::_ApplicationPtr pApplication;
Excel::_WorkbookPtr pBook;
HRESULT hr;
_variant_t varOption( (long) DISP_E_PARAMNOTFOUND, VT_ERROR);
CoInitializeEx(NULL,COINIT_MULTITHREADED);
hr = pApplication.CreateInstance(__uuidof(Excel::Application));
if (FAILED(hr) )
{
return 0;
}
pBook = pApplication->Workbooks->Open( (_bstr_t)fileNameopen,varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption );
Through this code i am eable to open ecxel Unprotected.But i have protected excel file then excel file ask password.So Can i remove password or get password?
I cann't use third party tool.Please advice me what i do? if any dll available then please give me link.
|
|
|
|
|
Why should we help you cracking Excel?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok i am not going to force to help me.Just i ask a question.If you think to help me then most welcome or if not then also most welcome.
I need this type of scenario.So I ask here.
Thanks
|
|
|
|
|
If you have lost the password, I guess you may search for a password recovery tool.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No i am not trying to use third party tool.Any way
Can you give a one basic idia there is any more way to open excel file accept(office automation).
Regard's
Rdop
|
|
|
|
|
try using odbc ..
Failure is Success If we learn from it!!
|
|
|
|
|
|
I created a right-click menu the only problem is binding it to the cursors x/y position.
HMENU Controls = CreatePopupMenu();
AppendMenu(Controls, MF_STRING, 0, L"Resume");
AppendMenu(Controls, MF_STRING, 0, L"Pause");
AppendMenu(Controls, MF_SEPARATOR, 0, 0);
AppendMenu(Controls, MF_STRING, 0, L"Delete");
AppendMenu(Controls, MF_SEPARATOR, 0, 0);
AppendMenu(Controls, MF_STRING, 0, L"Change Filename");
AppendMenu(Controls, MF_STRING, 0, L"Change URL");
AppendMenu(Controls, MF_SEPARATOR, 0, 0);
AppendMenu(Controls, MF_STRING, 0, L"Check MD5");
TrackPopupMenuEx( Controls, TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON | TPM_HORPOSANIMATION, xPos, yPos, g_hWindow, NULL);
int xPos and yPos are casted globally.
case WM_MOUSEMOVE
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
It's definitely cursor position detection problem.
|
|
|
|
|
You failed to mention the problem!!!
-Saurabh
|
|
|
|
|
The menu doesn't appear where the cursor is!
not binding?!
|
|
|
|
|
Binging menu to mouse does not makes sense and I was not able to understand which binding you were referring to.
Anyway, the coordinates should be in Screen Coordinates System. Use ClientToScreen[^] to convert from window to screen coordinate system.
-Saurabh
|
|
|
|
|
In your right-click handler, have you tried calling GetMessagePos() to get the X/Y coordinates?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Sorry for the strange title but couldn't think of how else to describe this.
The pre-amble is that as a hobby project I am trying to refactor some old, very unweldy C Dlls to use C++ classes to make maintenance and general understanding of what is happening a lot easier.
The problem is that many people already already call these Dlls and thus my understanding is that if I make it into classes (unless I add a lot of #defines which is what I'm trying to avoid) it would break a lot of stuff. The one lucky thing is that the old C Dlls exported only a few functions and everything was routed through those functions (basically a giant switch statement to determine what processing to do internally).
I am trying to see if there is another way to hide the fact that internally the Dll uses classes so that C code can call it without worrying about it. Any thoughts?
|
|
|
|
|
I am little confused, how can your hobby project break other people stuff.
Also I am not sure what exactly is your problem. You don't necessarily have to export all symbols from a DLL, like the C version of the DLL you talk about. You can redesign you functions into set of classes and choose not the export them. Then you can make the functions exported in the C DLL call these class to do the job. This way it won't break the interface.
-Saurabh
|
|
|
|
|
If you expose the same interface from that DLL, it doesn't matter if you implement it internally as C, C++ or Ada - it won't break the people who use the DLL.
So...keep those interface functions and re-route them to use your classes internally and you should be good.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|