This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to throw exception from c++ dll?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Feb 20, 2008
02:11 PM
How to throw exception from c++ dll?
Hi
Is it possible to raise an 'exception'(could be com error) from a c++ dll
in such that i can trap it in install script?
Thanks in advance
Is it possible to raise an 'exception'(could be com error) from a c++ dll
in such that i can trap it in install script?
Thanks in advance
(3) Replies
‎Feb 20, 2008
05:29 PM
What kind of project? I haven't tried it, but it seems it might work with an InstallScript project, but I'm a little less hopeful about MSI...
‎Feb 21, 2008
10:13 AM
One of the big rules about exceptions and C++ is that it's a bad idea to cross DLL boundaries with them. COM uses HRESULTs to indicate failure cases that higher level languages will tend to turn into exceptions. If you're using a COM call from InstallScript to get into your C++, returning a failing HRESULT might already do this. If you're using a direct DLL load and call, I expect it won't, but you can check the return value and turn it into an exception on the InstallScript side yourself.