|
Thank you for answering my message!
In fact that it is the control of Digital I/O of an industical PC.
I need to use mfc to do it because it is only a part of my program.
Can you give me more hints to do it?
Please help!
|
|
|
|
|
My guess would be that there are 2 options - see if you can use the exact assembler code you list (MOV, MOV, INT), or else find out what the calls actually do, and try to repeat that functionality using C++.
This article http://www.codeproject.com/cpp/extasm.asp[^] has examples on how to include assembly statements into your code. There are restrictions on what you have privilege to do as a "normal" program (i.e. not part of the kernel) but I can not remember that stuff any more. If you want some ideas, look at http://www.codeproject.com/system/soviet_kernel_hack.asp[^] - I have no idea what that article means, though!!!
Trying to find out what the code actually does may be easier, as long as the system is not too old. What documentation do you have? The programmer's guide for the PC, which should be available if you are trying to use features which are specific to the PC, should have this information.
|
|
|
|
|
Thank you very much!
I found that it is using a chip set W83627HF.
Now I can use the "inpout32.dll" to set it.
Do you how to access it without using "inpout32.dll"?
I think it should have driver inside the Windows.
Please help!
|
|
|
|
|
To start off, download www.winbond.com/PDF/sheet/w83627hf.pdf[^], if you do not have it already.
This PDF document tells you for the Winbond chip what information is available at what port address, so you can use InpOut32.DLL to read information, or to write settings. For example, look at figure 2.1 on page 23.
But this still does not tell you how to replace the MOV, MOV, INT instructions. As far as I know, the MOV, MOV, INT instructions are motherboard BIOS functions - if you can find out what these actually do (maybe from motherboard documentation), maybe you can use the W83627 documentation and get the same effect by using INPOUT32 to write to or read from ports.
|
|
|
|
|
Now I can use the inpout32.dll to do the same effect.
But I would like to do it without using inpout32.dll.
Do you have any suggestion?
Please help!
|
|
|
|
|
Sorry - I used inpout32.dll when I wanted to do direct port I/O! I was quite happy with it.
Since you have not said what the BIOS call actually does, I can not guess how to implement it.
My suggestion would thus be to try to use inline assembler, and use the exact assembly instructions you gave in the original post.
You may have problems with privilege, in which case, search codeproject for PRIVILEGE, and see if you find anything useful.
|
|
|
|
|
The BIOS call is used to control the General I/O port of W83627HF chip set.
I just want to make my own driver instead of using inpout32.dll.
|
|
|
|
|
OK, seems a reasonable goal.
When I had to do port I/O under Windows NT / XP, I chose the easy route and used inpout32.dll. Others choose to do it the difficult way, but they learn more in the process!
Good luck.
|
|
|
|
|
Thank you very much!
I will try my best!
|
|
|
|
|
Hi,
For the first time I am posting a question.
Problem Context:I am writing a VC++ DLL in VC++ 6.0 . The dll is used in toll called Diadem. The dll is registered in this tool, so when the tool starts, it loads all registred dlls. then you can call any function defiened
in the dll. The function which I am calling creates link list(creates memory on heap), reads a text file, processes data and creates another text file. Thats all.
Problem Facing : When the control is suppose to return from the function written in dll, the main application(tool) goes into 'NOT RESPONDING' mode.
All functionality in the function written in dll is executed well, but while
returning it is giving error.
Regards,
Amol Ravatale
|
|
|
|
|
|
1)When i test the dll in debug mode(of VC++),it gives run-time error as follows:
Error type: ACCESS VIOLATION
Error address: 00001C42
Module name: COMMANDS.DLL (name of dll I am writting and calling from Diadem tool)
I am using FOR Loop for around 200 iterations and in that loop again one more FOR Loop for around 8000 iterations
2)another case is if function in dll is used without debug mode,
it does not give any error message and the application simply hangs.
For this 2nd case Kakan has already given solution to create thread and call
function from that one.
Regards,
Amol B. Ravatale
|
|
|
|
|
Hello.
You are a bit unclear of the problem, but I suspect it it like this:
When your program calls a function in the dll, then your program stops responding to events, right?
If that's the case, then the reason is that the called function (in the dll) takes a long time to execute, and during that time the program stops responding.
The you will need to create a thread. From that thread, call the function in the dll.
That way, your dialog will respond to Windows events.
Kakan
|
|
|
|
|
Kakan You are right, the function written in dll takes long time as there is for loop for 200 iterations, in this For Loop again one For Loop for around 8000 iterations.
Thank you very much....
for your kind help
Regards,
Amol
|
|
|
|
|
Just try to include the function code in ur application
and then check out what error it gives
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi all,
I want to save and load a html file...iam using CHtmlEditDoc::OnSaveDocument but i wanted to store the images as well as the script..is there any sample program available to store the html file.
|
|
|
|
|
I need a good software to create pad.xml file.
pad.xml is used for submitting softwares to download sites.
I have used several pad cretors, such as PADSetup.exe, padinst.exe. they are really ugly.
which software do you use for create pad.xml file?
includeh10
|
|
|
|
|
|
includeh10 wrote: which software do you use for create pad.xml file?
why don't you create that UrSelf buddy!.., Its very simple for experienced Guy like you... here is handy wrapper class for XML writing :-
http://www.codeproject.com/soap/markupclass.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
To create any .xml file, can't you just use DOMDocument or IXMLDOMDocument2 ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Currently using VS2005
I've built a MFC VC++ app and DLL, I don't think there's anything included that has anything to do with .net (tried to do that specifically)
I currently have sent all these following files with my program (something called UDPTester.exe and LinkUtils.dll) and it still doesn't work.
mfc80.dll
mfc80u.dll
mfcm80.dll
mfcm80u.dll
(the MFC files)
msvcr80.dll
(one VC file that MS says should be there with MFC80.dll)
I can post all my Stdafx if people really want.. but that's a long file.
An exerpt is
[code]
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxsock.h>
[/code]
The error messages after all the files (4 MFCs 1 CRT, 2 files I wrote) are all linked up comes up as stuff like "application configuration is incorrect"
Is there any other files that might be needed?
Is there any way I could try out the program on my computer with out getting another or reformatting windows to take out the stuff?
I've built it both as "Use MFC in a Shared DLL" and "Use MFC in a Static Library" Any advice is appreciated.
|
|
|
|
|
You need to use manifests with 2005...
Visual Studio 2005 does not support building C++ applications without a manifest and binding to Visual C++ libraries the old way using %PATH%. Moreover, Visual C++ DLLs can detect this, prevent the DLL from loading and report the unsupported scenario and the necessary changes. Do not use /manifest:no or delete the manifest.
See Deployment Examples for more info.
---
If you just want to throw your app on a test machine without using an installer, you can copy the appropriate folders in C:\Microsoft Visual Studio 8\VC\redist\x86 (you most likely want the CRT and MFC folders) to the folder where your .exe resides on the test machine and it should work. Worked for my laptop.
Bernie (Boom Boom) Geoffrion worked Atlanta Flames games in the 1970s with the splendid Jiggs McDonald. One night, Geoffrion said, "Jiggs, there are only three things to hockey: shooting and skating." McDonald said, "Right, Boomer. And what's the third?" The exasperated Geoffrion replied," Jiggs, that's the three. Shooting. And. Skating."
|
|
|
|
|
If I remember correctly Vs6 (and possibly Vs2003) did not require this or redistributing the MFC DLLs.
If this is true is there any reasons you can give me to continue to work with VS2005 rather than go back to VS6, for my non .net/C#/ASP programming?
-- modified at 23:52 Tuesday 29th November, 2005
It appears I am making manifests, internally into the binaries, however I'm still recieving these errors.
-- modified at 2:36 Wednesday 30th November, 2005
It appears that no matter what I do, I need to package my code with the MFC Dlls and the CRT dlls.. This is less than optimal and I'm not sure if VS6 required this. The question that I have now is one where, does VS6 require this. Or will a small 100K MFC program always require the 1meg or more of files for CRT (not even meantioning the size of MFC files).
At least it appears to load, so thank you, I appreciate that, it helps a lot.
|
|
|
|
|
King Link wrote: mfc80.dll
mfc80u.dll
mfcm80.dll
mfcm80u.dll
(the MFC files)
msvcr80.dll
(one VC file that MS says should be there with MFC80.dll)
I think you should add msvcr80d.dll and mfc80d.dll dlls too.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
you could use the dependancy walker VisualStudio tool to check those requiered dll...
see here[^]...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|