|
I've seen this before. In my case it was caused by stack corruption breaking the exception handling chain (which is on the stack). I've got an application at home that intentionally reproduces the problem. When I get home I'll send it to you if you think it will be of any help.
Steve
|
|
|
|
|
I sent the application. Did you recieve it?
Steve
|
|
|
|
|
hi, i have made a program that will load other programs from dll files. i have it working just fine on my own pc but when i go to have someone else test it, it fails to load anything at all. am i doing soemthign wrong with how i have my program loading the dll files?
|
|
|
|
|
swatgodjr wrote: am i doing soemthign wrong with how i have my program loading the dll files?
When you are using the DLL on your M/C no problem because that DLL is already registered on your M/C
When you use it on other M/C the Application is not able to find the Registered DLL.
So try to register your DLL on Other M/C where you execute your Application.
use Regsvr32 - for registration
use Regsvr32 /u - for unregistration.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
i tried to use that on another pc but it came back sayign it could not be found on the pc.
|
|
|
|
|
swatgodjr wrote: i tried to use that on another pc but it came back sayign it could not be found on the pc.
Is it your DLL ( created by you for your application) ?
if no then
What is the name of the DLL ,that you trying to load ?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
i made the dll myself, i am using LoadLibrary to load it in my program.
originally my application was console based and it ran perfectly, loaded on any pc i put it on. but since turnign it into a dialog based gui application, using the exact same loading code, it fails to load now on any pc but mine.
|
|
|
|
|
Pay special attention to the search order in the LoadLibrary documentation. Where your dll is in relation to the "Paths" searched is important. A_Laxman mentioned the COM based way of how the dll path is "registered" in the registry so an app can search the ProgId or CLSID of the component to obtain the info such as what it's path is. You are basically trying to achieve the same end via whatever means you have at your disposal.
If you don't ensure your dll is located in one of the paths mentioned in the LoadLibrary documentation (Try not to rely on the PATH environment variable as this is a user configurable item and subject to change when users jack around with their settings), you might want to have your app installation msi place the path in your registry space for your installation. I do this and then retrieve the settings (including the path to the apps "bin" directory which is where I place my dll's).
If your using VC++ 6.0, you will probably need the Visual Studio Enterprise Installer 1.1 to quickly build your MSI's. You really shouldn't be deploying apps that have dll's and other components without an MSI (at least in native C++ deployment)
here's the link..
Visual Studio Installer[^]
This also make COM component registration/unregistration an automated process and simplifies things since it puts your app in the add/remove programs applet window.
-- modified at 11:23 Tuesday 23rd May, 2006
|
|
|
|
|
the way my app works is nothign really big and complicated, its just a simple program i made to mess aroudn with. i do not "install" it on a pc in any way, i just send it to friends to test if it works. basically you open the exe, go into a screen where you type in the dll to load and the program loads it. its not complicated at least not in my eyes. i did notice that on my pc loadlibrary call is all i need to load the dll file, i do not have to get any addresses to the functions. but when i tell it to do that it crashes after i close the dll. my consoel based version works perfectly on any pc yet migrating the whole thing over to gui based seems to have changed how it does the loading of my dll files.
|
|
|
|
|
Are we sure the DLL is COM based?
You may be dealing with a traditional dll here that uses LoadLibrary(). The thread initiator did not specify this unfortunately.
|
|
|
|
|
Hello,
When I created a small test file:
<code>
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int number;
cout << "Enter a number (1 or 2): ";
cin >> number;
if (number != 1 || number != 2)
{
cout << "You didn't enter a 1 or 2" << endl;
}
else
{
cout << number << endl;
}
return 0;
}</code>
The result always "You didn't enter a 1 or 2" no matter what number was entered. I tried changing the code to:
<code>
if ((number != 1) || (number != 2))
</code>
with the same results. Any clues? Thanks in advance.
|
|
|
|
|
|
Shane Ragone wrote: (number != 1 || number != 2)
Try writing a truth table for this and see what the result is . You'll find that the result is always true. What you actually want is if (number != 1 && number != 2)
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi guys,
I am using isinf() function in my program. But in VC++ it is giving me the error "isinf undefined identifier". Does anybody know how to make isinf() function work in VC++?
Thank you very much.
jay111
|
|
|
|
|
_fpclass
bool isinf(double d)
{
int fpc = _fpclass(d);
return fpc == _FPCLASS_NINF || fpc == _FPCLASS_PINF;
}
Some of us walk the memory lane, others plummet into a rabbit hole
Tree<t> in C# || Fold With Us! || sighist
|
|
|
|
|
hi peterchen,
thanx for your reply. I didnt quite get what you r saying in your reply...I can compile my program in unix shell with gcc compiler without any error. But i want to port my project to VC++. But in VC++ it is giving i m getting the error.
thanx,
jayashri
jay111
|
|
|
|
|
What peterchen is (probably) telling you is that isinf() is not part of the Win32 API, hence the need to make your own.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
oh ok...thanks. so there is not easy way to check for infinity in VC++...
jay111
|
|
|
|
|
jayashri2006 wrote: so there is not easy way to check for infinity in VC++...
Not that I know of, unless you are using the .NET framework.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
oh, actually I am using .net framework...do u know the alternative way?
jay111
|
|
|
|
|
Then check out the Double.IsInfinity() method.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
|
Hi All,
In VS 6 I copy data from a custom control on a dialog using my own clipboard management (see code below) and would like to paste it into a CEdit on the same dialog. I believe I am getting it to the clipboard correctly, in CF_TEXT format because I can paste the text into WordPad or Notepad just fine. I am unable, however, to paste my clipboard contents to the CEdit either with the CEdit context menu or Ctrl+V. Making this all the more confusing is that if I copy text from Wordpad, which presumably is in CF_TEXT format, I am able to paste into the standard CEdit just fine.
Any ideas would be greatly appreaciated!
Thanks,
Doug
CString cellText = "This is a test";<br />
<br />
<br />
OpenClipboard();<br />
EmptyClipboard();<br />
<br />
<br />
int dataStringLen = cellText.GetLength();<br />
HANDLE dataHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,dataStringLen + 1);<br />
char *memPtr = (char *)GlobalLock(dataHandle);<br />
<br />
<br />
memcpy(memPtr,(char *)(LPCTSTR)cellText,dataStringLen + 1);<br />
memPtr[dataStringLen] = '\0';<br />
<br />
<br />
GlobalUnlock(dataHandle);<br />
SetClipboardData(CF_TEXT,dataHandle);<br />
GlobalFree(dataHandle);<br />
<br />
CloseClipboard();
Doug Knudson
|
|
|
|
|
<br />
if(OpenClipboard()){<br />
CString cellText = "This is a test";<br />
HGLOBAL clipbuffer; <br />
EmptyClipboard(); <br />
clipbuffer = GlobalAlloc(GMEM_DDESHARE, cellText.GetLength()+1); <br />
<br />
char * buffer; <br />
buffer = (char*)GlobalLock(clipbuffer); <br />
strcpy(buffer, LPCSTR(cellText)); <br />
GlobalUnlock(clipbuffer); <br />
SetClipboardData(CF_TEXT,clipbuffer); <br />
CloseClipboard();<br />
}<br />
hi
|
|
|
|
|
Thank you very much! Works like a charm!
Doug
Doug Knudson
|
|
|
|