|
I have made an MFC Application that works against a SQL Server using ODBC with the CRecorset classes. But when I hav made a workable setup program and runs this on another computer(that does not have visual studio) the installation works fine but when i try to run the exe file i get a VC++ Runtime library Error! Abnormal program termination. What have I've done wrong ..please Help..
Best regards
Henrik
|
|
|
|
|
use the 'depends' tool to see what dll's ur app requires and make sure they are in the package u dist
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
I would but I'm running VS . net and the dependencies shows up on a prpertysheet.. it only says that it depends on 2 dll's mfc70*..... Are there any other way?
If not...
Thank you for your reply anyway
|
|
|
|
|
HenrikO wrote:
I have made an MFC Application that works against a SQL Server using ODBC with the CRecorset classes. But when I hav made a workable setup program and runs this on another computer(that does not have visual studio) the installation works fine but when i try to run the exe file i get a VC++ Runtime library Error! Abnormal program termination. What have I've done wrong ..please Help..
What type of error are you receiving when you try to run your app? Does the PC you are trying to set up your app on have all the MFC runtime libraries installed? You should read through this part of the C++ FAQ. It deals with a problem that sounds similar (if not exactly the same) to yours. Hope this helps.
-Mike Zinni
Software Engineer
email: mzinni@rimail.com
AIM: zin9999
|
|
|
|
|
Try using Installshield . it actually does the job of searching for dll's and required ocx's required .
or
While building the code , check the project settings. Try including all the dll's during compilation.
or
if u know the dlls required , copy them in the new pc and register theses Dll's using regsvr32.exe
|
|
|
|
|
Do you have the same version of MDAC installed on both machines?
Also does the release version work on your development machine?
Michael
|
|
|
|
|
Hi,
I´m making a thing that seems to work ok, but I´m not quite sure if it´s right done or not ( my ANSI C experience tell me... NAAAAA ! MALLOC MAAAN AND COPY THE BUFFER.... ), it´s quite basic asigning to a text node an (char *).
char buf[255];
MSXML2::IXMLDOMNodePtr pCostSelNode = _pXMLClonedDoc->selectSingleNode((BSTR) strCostSelNode);
if(pCostSelNode != NULL) {
itoa(iIndex, buf, 10);
pCostSelNode->text = buf;
}
Is correct to assing to the bstr that buffer in that way ( I suposse if it´s _bstr_t friendly it should but... ).
Thanks in advance, greetings
Braulio
|
|
|
|
|
What is the type of strCostSelNode ?? If it is not BSTR, you must convert it. Typecasting is not enough, in the case of a BSTR. Ex:
<br />
USES_CONVERSION;<br />
wchar_t *strCostSelNodeW;<br />
char *strCostSelNodeA;<br />
_TCHAR *strCostSelNodeT;<br />
<br />
BSTR bsCostSelNode1 = W2BSTR(strCostSelNodeW);<br />
BSTR bsCostSelNode2 = A2BSTR(strCostSelNodeA);<br />
BSTR bsCostSelNode3 = T2BSTR(strCostSelNodeT);<br />
<br />
MSXML2::IXMLDOMNodePtr pCostSelNode = _pXMLClonedDoc->selectSingleNode(bsCostSelNode1);
<br />
::SysFreeString(bsCostSelNode1);<br />
::SysFreeString(bsCostSelNode2);<br />
::SysFreeString(bsCostSelNode3);<br />
Tell me if you need more info.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Thanks for the tip,
Sorry, I forgot to write there the type of strCostSelNode, and it was "CComBSTR".
Anyway is a perfect example for me, if I have to convert from all that types to BSTr, thanks a lot.
Braulio
PS.: If I declare a variable in MFC using _bstr_t, do I need to free it, before it goes out of scope ?, b.g.:
void MyMethod()
{
_bstr_t MyVar = "MyText";
(...)
}
|
|
|
|
|
I want to display the CFontDialog dialog with the DoModal() method, but the font and it's properties (size, style, colour) already selected.
For example when the dialog is displayed, the Arial 12 italic RED is selected.
How do I do that ?
|
|
|
|
|
After you've created you dialog, but before DoModal(), modify the m_cf member of your dialog. Set m_cf.Flags to CF_INITTOLOGFONTSTRUCT and m_cf.lpLogFont to point to a LOGFONT object of your choice.
You can use CFont::CreateFont() to initialize a font, and then use CFont::GetLogFont() to get the underlying LOGFONT.
|
|
|
|
|
I have tried like you told me:
CFontDialog dlg;
LOGFONT* logf;
logf=new LOGFONT;
font1.GetLogFont(logf); //font1 is a valid font created before (Arial 12)
dlg.m_cf.Flags=CF_INITTOLOGFONTSTRUCT;
dlg.m_cf.lpLogFont=logf;
dlg.DoModal();
It doesn't work. I get an assertion failure at the DoModal method. If I debug it, the error is at the line:
ASSERT(m_cf.Flags & CF_ENABLEHOOK); in the CFontDialog::DoModal method, defined in dlgfnt.cpp.
If I don't debug it and I choose Ignore, It says: "There are no fonts installed. Go to the Control Panel.......".
What is the problem ?
|
|
|
|
|
it's ok. I resolved that. I had to set also the flags CF_ENABLEHOOK | CF_BOTH | CF_EFFECTS.
Thanks.
|
|
|
|
|
It should be set like:
dlg.m_cf.Flags |= CF_INITTOLOGFONTSTRUCT;<code><br />
to keep old flag values.<br />
<br />
Your solution will probably work aswell.
|
|
|
|
|
Does anyone remember where the standard cursor resources (such as IDC_SIZEALL) are located (which file)?
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I'd say they are in shell32.dll.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Not sure, but I'd go for the mfc dlls.
/moliate
|
|
|
|
|
Something like that is definitely going to be in one of the Windows DLLs. I just didn't want to have to manually open each one and search through its resources. Thanks anyway!
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
USER32.DLL, then...
Guess you already found it, though.
/moliate
|
|
|
|
|
Yeah But thanks!
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Is there a simpel way to create a monochrome bitmap from a multicolor bitmap?
I need to create a mask for MaskBlt. This mask should be monochrome according to MSDN. Assuming only one color will apply to 1 and the rest to 0 in the mask.
Any help would be appreciated.
|
|
|
|
|
are u meaning at runtime or design time?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
Thanks, I did mean at runtime.
|
|
|
|
|
The sample is in MSDN. Try looking for "transblt", "transblit" or something like that.
|
|
|
|
|
Roger.
TransparentBlt(), Thanks.
|
|
|
|