|
Hi,
I had used Visual C++ AppWizard to create a database using Microsoft's Access but when I copied the whole program into other PC, I could run it.
Listed below is the error message I received.
Error Message - Unable to Locate DLL
The dynamic link library MFC42D.DLL cound not be found in the specified path...
How to I solve this problems?
Need Help
|
|
|
|
|
You find all the DLL file in CD ROM of Visual C++ or Microsoft Access. And then, copy them to C:\Windows\System.
Example: MFC42D.DLL Show on the Error Message
|
|
|
|
|
Hi,
The "Unable to Locate DLL" error is gone but I'm getting another error of "Data source name not found and no default driver specified".
Please Help..
|
|
|
|
|
I'm just guessing here, but this is an ODBC application, and your second machine doesn't have an ODBC source configured, or you have hardcoded the path to your database and it doesn't exist in the same location on the second machine.
Tim is right; it's illegal to redistribute the debug DLLs that Microsoft supply as part of Visual C++, as you will then be in breach of your license agreement.
Steve S
|
|
|
|
|
Ok, I know this is a bit anal, but...
You can not legally redistribute any of the debug libraries. If you are actually trying to distribute this program, then build it in release mode.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
siew hoon wrote:
The dynamic link library MFC42D.DLL cound not be found in the specified path...
You need to compile the application in release mode before distributing it. The only machines that will have the debug versions of the MFC libraries (e.g., MFC42D.DLL) are those with Visual Studio installed. Otherwise, distributing the debug versions of the MFC libraries is against the rules!
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Ok, I manage to run the database on a PC with Visual C++ installed. I still don't understand why can I run the .exe file on other PC without Visual C++ installed? I .exe file is an executable file right? I thought .exe file can run in any PC
|
|
|
|
|
siew hoon wrote:
I still don't understand why can I run the .exe file on other PC without Visual C++ installed?
Perhaps you meant "can't." This has already been explained. The .exe depends on one or more DLLs that are not present on machines not having VS installed.
siew hoon wrote:
I thought .exe file can run in any PC
That's correct, assuming all necessary files are present.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Oops, it's a typing error. Should be "can't". Ok, I got the message.
Thank you.
|
|
|
|
|
Hi all;
I am building an application which will need to present quite a few statistics. I was wandering whether to use Microsoft Chart or MS Office chart 9.0. Anyway, can anybody help me in finding a tutorial on eithe please. I badly need it.
Thank you;
Krugger
|
|
|
|
|
Hello,
After enumerating windows, I need to know that a given window CAN accept keyboard input, how can I check that? (By keyboard input, I mean the alphanumeric keys + punctuation keys only, no control keys or extended keys!).
No help with IsWindowEnabled() , because it returns a TRUE for windows like the "Microsoft Outlook" main window. Now that is not what I want, because the MS-Outlook main window DOES not accept any alphanumeric keys or punctuation keys. It accepts control keys like ALT+F, UP, DOWN, TAB, SHIFT-TAB, CTRL-O, etc. But it is the MS-Outlook e-mail composer window (which opens when you want to compose a new e-mail), which can accept alphanumeric keys or punctuation keys. I want the composer window to be listed and the MS-Outlook main window, not to be listed.
Something like the MSN Messenger, ICQ and Yahoo! Messenger main windows. They don't accept alphanumeric + punctuation keys, but only control keys. But the chat window, accepts alphanumeric + punctuation keys.
Is there any way that you have tried something similar, or are you aware about how can I get this going?
Thanks,
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
As far as I know, there is no general purpose way to detect if an arbitrary window accepts keyboard input.
There are a couple of things you can try. One, retrieve the class name of the window. The builtin Windows controls (edit, etc.) have well-known class names. Once you know the class name, you can use messages specific to the class to discover how the control is set up, and find out what keys it accepts.
Two, the WM_GETDLGCODE message will get a little of the information you are looking for. It is used by the Windows dialog manager to find out what keys a control in a dialog wants.
BTW: The IsWindowEnabled() function only tells you if the window is enabled, i.e. that it accepts user input. User input means keypresses and mouse activity. Unfortunately, as you've discovered, this has nothing to do with the type of user input the window accepts.
Software Zen: delete this;
|
|
|
|
|
Thanks Gary!
I will start looking at the options you've explained!
Thanks again,
- Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Hello,
I am trying to make a little Windows console telnet program but I have the following problem and I have no more idea. Every time when the user presses a key, the input is sent to the remote host. The receiving data is printed to the console screen. Mostly when the user presses ENTER, the input is sent and also received but it is _not_ printed to the screen. The ENTER is printed when a second ENTER or any other key is pressed, or when another application is activated. Can anybody tell me why the ENTER is not printed immediately?
Please also tell me the "dont's" of my little function because I began programming a few months ago.
Thank you,
/ms
void Verbinder::manuellI()
{
DWORD anzahl = 0; // number of INPUT Records
DWORD consoleMode; // saved console mode before changing it
DWORD geschrieben; // number of written chars
DWORD recRead = 0; // number of written events read with ReadConsoleInput
HANDLE msConsole; // Input Handle for the console Console Fenster
HANDLE msConsoleO; // Output Handle for the Console Fenster
bool ende = false; // true when ALT+N is pressed
char zuSenden; // key which should be sent to remote host
msConsole = GetStdHandle(STD_INPUT_HANDLE);
msConsoleO = GetStdHandle(STD_OUTPUT_HANDLE);
if (!GetConsoleMode(msConsole, &consoleMode))
{
//error
}
if (!SetConsoleMode(msConsole, NULL))
{
//error
}
// deactivate Nagle:
/*int nagleOff = 1;
if (setsockopt(verbindungsSock, IPPROTO_TCP, TCP_NODELAY, (char *) &nagleOff, sizeof(nagleOff) == -1) == SOCKETERROR)
{
//error
}*/
unsigned long dataToRead = 0;
while (!ende)
{
GetNumberOfConsoleInputEvents(msConsole, &anzahl);
INPUT_RECORD *inBuf = new INPUT_RECORD[anzahl];
ReadConsoleInput(msConsole, inBuf, anzahl, &recRead);
for (DWORD i = 0; i < recRead; i++)
{
int bytes = 0;
if (ioctlsocket(verbindungsSock, FIONREAD, &dataToRead))
{
bla.fehlerAusgabe("ioctlsocket Fehler! Manueller Modus nicht moeglich!");
ende = true;
break;
}
while (dataToRead)
{
bytes = recv(verbindungsSock, buf, BUFFER_SIZE - 1, 0);
if (WSAGetLastError())
{
bla.fehlerAusgabe("Kein Socket fuer die Verbindung!");
ende = true;
i = recRead;
break;
}
buf[bytes] = 0x00;
WriteConsole(msConsoleO, buf, bytes, &geschrieben, NULL);
if (dataToRead >= 1024)
{
dataToRead -= 1024;
}
else
dataToRead = 0;
}
switch (inBuf[i].EventType)
{
case KEY_EVENT:
switch (inBuf[i].Event.KeyEvent.dwControlKeyState)
{
case LEFT_ALT_PRESSED:
case RIGHT_ALT_PRESSED:
{
// process ALT
break;
}
default:
break;
}
if (inBuf[i].Event.KeyEvent.bKeyDown && inBuf[i].Event.KeyEvent.uChar.AsciiChar)
{
zuSenden = inBuf[i].Event.KeyEvent.uChar.AsciiChar;
uint sentBytes = send(verbindungsSock, &zuSenden, 1, 0);
if (sentBytes != 1)
{
//error
}
break;
}
default:
break;
}
}
delete[] inBuf;
inBuf = 0;
}
if (!SetConsoleMode(msConsole, consoleMode))
{
//error
}
}
|
|
|
|
|
Are you referring to a console redirector? Check out MSDN.
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q190/3/51.asp&NoWebContent=1
Kuphryn
|
|
|
|
|
I am not sure but I don't think so. I am only using the standard console handle and I am only referring to this handle and I am using the WriteConsole() function for output.
/ms
|
|
|
|
|
I need help with something that I think is simple I just don't know how to do or how to implement it. I want to create a global variable that can be used by all of my dialog boxes. When I say used I don't just mean viewed, I would also like to be able to write to it. Thanx for all your help
P.S. If by chance anyone has the time or knows how to make a edit box appear or dissapear that would be helpful too. I figured out how to do this with buttons but when I try it the same way with edit boxes it gives me a error and I dont' know where to go from there.
Sincerely
David Berg
email: quake3b@yahoo.com
AIM: CaNorDBerG
|
|
|
|
|
Question 1: Global variables in C/C++ work like the following. Suppose you have three source files, Src1.cpp, Src2.cpp, and Src3.cpp, and you want a variable to be global between all three. Variables have to be declared exactly once, so we'll do that in Src1.cpp:
int TheGlobalVariable; The other two sources will define the global as extern like this:
extern int TheGlobalVariable; The extern keyword lets the compiler and the linker know that this variable is declared elsewhere (which means that it's storage is in another place).
Question 2: All windows (buttons, edit controls, anything) can be made to 'appear' and 'disappear' the same way, using the ShowWindow() function. The basic Win32 API function is like this:
ShowWindows(HWND window,int show_cmd); where window is the handle to the window, and show_cmd is the operation you want to perform. The two values for show_cmd you are interested in are SW_SHOW and SW_HIDE which 'show' and 'hide' the window, respectively.
If you are using MFC, all windows ultimately have CWnd as a base class, which has the method
ShowWindows(int show_cmd); where show_cmd takes the same values as the Win32 API function.
Software Zen: delete this;
|
|
|
|
|
Minor typo: ShowWindows(...) -> ShowWindow(...) . (I know that's what you meant).
On a different note, many thanks for your excellent CP article Using the WebBrowser control, simplified[^]. I rated it 5 only because CP won't let me rate in any higher!
And now for a shameless grovel: any pointers on how to implement enum/get/set methods that would allow the user to enumerate all the identified (i.e. id=mumble ) HTML elements in the current document, and peek and poke them? In other words, I'd like to be able to programatically select/clear/populate GUI elements (check boxes, radio buttons, text fields, etc.). I'm guessing I'd have to diddle with IHTMLDocument2 but I'm so COM disadvantaged it's pathetic.
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
CP won't let me rate in any higher
Glad you liked it.
Ravi Bhavnani wrote:
any pointers on how to implement enum/get/set methods that would allow the user to enumerate all the identified (i.e. id=mumble) HTML elements in the current document
You've hit on the right approach. IHTMLDocument2 is the place to start. It lets you enumerate the contents of the document. Each piece in the document will be represented as an interface pointer to an object (like IHTMLElement ). You use those interface pointers to set/get properties of the element.
Software Zen: delete this;
|
|
|
|
|
I am writing a file system monitoring thread in c++ for win32 and it is critical to keep the thread running no matter what! is there any way to restart a thread if and when it exits (say due to an error). I found out that I can use the Wait functions to find out if a thread has exited using it's handle, but this requires another thread or process to monitor the monitoring thread. Is there a way of automatically restarting a thread?
|
|
|
|
|
This doesn't make sense. Simply ensure the thread never exits unless you want it to. You just need to handle all errors as req'd. Anything else is plain wrong AFAIC.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Neville, that sounds good, but in a mission critical environment it would be a poor practice. In mission critical software development you must plan for ALL events. The idea of creating a piece of software that is 100% bullet proof is just as silly as producing software that is 100% bug free. It just can't be done. Anyway, in some instances I would rather have the thread or the process crash and restart than to continue trying to limp on after an unexpected exception (such as an access violation). Anyway, since he is talking about a thread which might be running in a foreign process space, his own address space is always suspect and could have been damaged by another thread in the process.
Bottom line, he must plan for total thread failure.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi Tim,
I basically agree with you but I was left with the distinct impression that he wasn't really trying to handle errors, hence my reply. I mean if he is ok to let the thread crash then why not the app.
I run a number of worker threads in ED and untill now I never thought about the possibility of one crashing and having to be restarted. Mind you I put a loy of effort into trying to ensure everything is as robust as I can and then handling errors as best can be. This is an app that is used by a lot of people, but it certainly isn't mission critical.
I don't know where you picked up on the thread running in a foreign process space. That would indeed warrant a much more stringent implementation.
But as I said to start I basically agree with you.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Infact I am running the thread in a foreign process space. So I don't have an option of monitoring the thread status and creating a new thread if there is a termination. Inspite of handling errors extensively, I am worried that an abnormal termination is possible.
Neville, I did a bit of reading on win32 thread implementation and I do agree that the idea of a thread restarting itself doesn't make sense May be I have to rely on effective error handling
Thanks,
Aralguppe.
|
|
|
|
|