![]() | ![]() | ![]() |
| |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
![]() |
| | Tools |
| | #16 | |
| Quote:
It's a library of code you can access in your programs by dynamically loading it at runtime. In your case, inpout32.dll implements all the Windows specifics so you can easily access the ports with only 2 different functions. Simple as that. http://en.wikipedia.org/wiki/Library...ynamic_linking
__________________ Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ | ||
| |
| | #17 |
|
all you need to do is inport these 2 files (in the zip) to the project!!!
__________________ when you post that reply, im just kidding. | |
| |
| | #18 | |
| Quote:
gastonanthony appears to have done just that judging from the previous posts, so he'd already have the required files. If the DLL was missing, he'd get a more friendly error message, and if the .lib wasn't linked during the build stage, he wouldn't have an .exe
__________________ Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ | ||
| |
| | #19 | |
| Quote:
IT is very bad practice to start putting DLL's into the system32 folder that did not come with the OS. It was that kind of practice that has lead to DLL-hell DLL-Hell: When a programmer customises a system-dll and puts that in the system folder. Another programmer customises the same dll (for another program) as a result program1 no longer works Have that on a OS-scale modification and you start to see why Windows-95, Windows-NT, Windows-98, Windows-ME were soo unstable. 2k and XP overcame this to some extent by protecting SYSTEM-dependant DLL from replacement (except during a SP or patch). Other DLL's can still be perverted. RPM-based linux distrobutions have something called RPM-Hell or (dependancy-hell) where there is no disctict link between the dependacy of one DLL to another. Linux does not have the equiv of DLL-hell (as in programmers customising DLL's) since it is all open-source and If they want something in a *.SO they just submitt it, otherwise they will just make their own shared libary. Leave the DLL in the working directory to ensure no pain later | ||
| |
| | #20 | |
| Quote:
No drivers needed!. However, the driver I use works under 95 upwards, and although I could have written it so it's not required for Win95, I didn't see the point. So WinPicProg requires it's driver DLL for ALL supported OS's - Win16 isn't supported, as it's a 32 bit program. | ||
| |
| | #21 | ||||
| Quote:
Quote:
Quote:
Quote:
In fact, I'd find it easier to have the DLL out of my way into the win/sys32 folder during development, but to each his own I guess...
__________________ Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ | |||||
| |
| | #22 |
|
i will make this as easy as possible without being horrible. 1)copy the files out of the zip to the debug folder where the final built .EXE will be. 2)inport the dll and lib to the project, use the code shown. 3)use the built .EXE and inpout.DLL together.
__________________ when you post that reply, im just kidding. | |
| |
| | #23 | |
| Quote:
Admittedly, by using drivers to do this, it's done in a Windows safe way, but it's still bypassing a Windows safety feature. | ||
| |
| | #24 |
|
I've run this program Code: include "stdafx.h"
#include "conio.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
int main(int argc, char* argv[])
{
short data;
if(argc<2)
{
printf("Usage\n\n");
printf("partest1.exe ,,\n\n\n");
return 0;
}
if(!strcmp(argv[1],"read"))
{
data = _inp(atoi(argv[2]));
printf("Data read from parallel port is ");
printf("%d\n\n\n\n",data);
}
if(!strcmp(argv[1],"write"))
{
_outp(atoi(argv[2]),atoi(argv[3]));
printf("Data written to parallel port is ");
printf("%s\n\n\n\n\n",argv[3]);
}
return 0;
}
but when I replaced the _outp(atoi(argv[2]),atoi(argv[3])) by Out32(atoi(argv[2]),atoi(argv[3])), this was the error that occurred: error C2065: 'Out32' : undeclared identifier I think I saw someone posted in here that I need to replace _outp() with Out32() if I was to used the inpout32.dll? | |
| |
| | #25 | |
| Quote:
Looking at it, it's waiting for at least 2 command line arguments, the first being either commands "read" or "write", the second I'm not sure. Where did you get that source code? error C2065: 'Out32' : undeclared identifier means there is no such thing as function 'Out32'... You sure it takes a capital 'O'?
__________________ Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ | ||
| |
| | #26 | |
|
Ok, sorry, just went back and read the whole thread ops: The instructions danielsmusic gave you are incomplete. What he describes merely copies the files to your project folders. The .lib needs to be linked to your program. In Visual Studio/C++, once your project is opened, goto Project->Settings and click the Link tab. At the very end of the Object/library modules: text input box, type the name of your library file "inpout32.lib". Rebuild the project. From your DLLs website : Quote:
Also, since you don't appear to have a header file with that DLL, you also need to add thsee definitions at the top of your source file (preferably under the #includes) : Code: /* ----Prototypes of Inp and Outp--- */ short _stdcall Inp32(short PortAddress); void _stdcall Out32(short PortAddress, short data);
__________________ Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ | ||
| |
| | #27 |
|
well if you don't want to get it right don't follow what i did!
__________________ when you post that reply, im just kidding. | |
| |
| | #28 |
|
dlls stand for Dynamically Linked Libraries. Library - Shared functions Dynamically-Linked - Loaded only at runtime. This reduces program file sizes, memory required, and allows programs to "share" a common library. Any changes required need to be made only to the library, instead of updating all programs using the library. | |
| |
| | #29 | |
| Quote:
Might I suggest you read on Visual C++'s build options and project settings to get a better understanding? You could also just take a look at example programs that come with the inpout32.dll from the website gastonanthony linked in a previous post : http://www.logix4u.net/inpout32.htm.
__________________ Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ | ||
| |
| | #30 |
|
I'm not sure how to do it under windows BUT if I have a program like this #include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { printf("%f",sin(0.8)) return 0 } now if I compile this with gcc test.c it will fail since I have not linked the maths libary (in Linux this is libmath.so) So I need to do gcc test.c -lmath to link the maths libary (linux equiv of a DLL) into this program YOu are going to have to do the same in windows... | |
| |
|
| Tags |
| inpoutdll, visual |
| Thread Tools | |
| Display Modes | |
| |