I have 2 readers for RFID and some cards (from a Chinese company called "Daily RFID"). They
kind of work because they came with some demo software written in Delphi that reads the id of the card (myfare compatible, ISO14443A). The problem is that if I try to use the demo to write to them, it doesnt seem to work.
They have another demo written in C#, it compiles and runs, but when click on Connect, I get this error:
Unhanded exception.. unable to load
DLL 'BasicB.DLL'
So I put the DLL in %WINDOWS%/system32, but when I tried to run regsvr32 BasicB.dll, I got another error:
the module "BasicB.dll" was loaded but
hte entry-point DllRegisterServer was
not found. Make sure that "BasicB.dll"
is a valid DLL or OCX file and then
try again
I have written to the company but got no response.
I program in Objective-C, so I kind of understand c#, but how to make these cards work?
Should I continue with Delphi, and try to write to them with it? Or should I continue trying with C#? Either way, would I have to write the code to read/write to them, or is there any software to work with these modules?
You only use regsvr32 to register ActiveX (COM) DLLs. The DLL you're trying to register isn't one.
Putting the DLL in the %WINDOWS%\system32folder should be enough. In fact, it can be in your applications folder or anywhere on the PATH.
Related
I am working on a webapplication in .net using razor pages in the mvvm-model. I've written a crawler/parser in Python that I need to control from my .NET-project. So I found another stackoverflow post that helps me solve this issue.
In order to keep my Python environment clean and organized, I've used a virtualenv to keep my libraries (BeautifulSoup4 and Requests) separated from my global interpreter. This all worked out the way I wanted.
However, I have reached a point where I need to connect both applications. So I put me parser in a separated folder within my .NET project. Furthermore, whenever my form is validated etc and reaches my OnPostAsync-method, it starts a process just like the above mentioned post describes.
But when I hit the submit button I can see in my console it is unable to find the correct packages in my Python application, since I am getting the famous: ImportError: No module named 'bs4'. I am aware this error is known and widely answered before, but I have a different question.
Question
I'd like to know how I fix this error with respect to my .NET-project and the virualenv. So i.e., is there a way to use or to link my virtualenv from Python in my .NET-project?
My Python-project-structure is:
/app/
/src/ <-- Source code
/output/ <-- Not relevant
/tests/ <-- Not relevant
/venv/ <-- Installed libraries
main.py <-- Entrypoint application
If I understood your question well, you can specify which Python interpreter the script will be run with by modifying its first line, in the same way Bash does:
#!/path/to/venv/bin/python
There should be a file /venv/Scripts/activate_this.py which contains code to activate the venv in the current interpreter. The docstring of the file says
Activate virtualenv for current interpreter:
Use exec(open(this_file).read(), {'__file__': this_file}).
This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
My source is in the parent directory of /venv/ so I use the following to activate my virtualenv.
import os
venv_activation_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'venv', 'Scripts', 'activate_this.py')
exec(open(venv_activation_path).read(), {'__file__': venv_activation_path})
I am developing a C# program in WPF which scans a fingerprint, stores it somewhere on local disk and then read it in another program for further manipulation.
For fingerprint scanning, i am having futronic device FS80. I have got all the required dlls in the CD but the biggest problem for me is those dlls are not valid COM components so not able to add them as a reference in my project. Anyhow I managed to add them using dllImport through coding but now I dont know which are the functions the dll contains and what are their parameters and use.
Totally stuck at the first phase only. Very frustrating because its my first attemp with wpf and device integration.
Can anyone please guide me how to integrate FS80?
I searched on futronic site but they are only providing sample exe and no code.
If anyone is having any type of idea please share.
I found something helpful.
http://read.pudn.com/downloads110/sourcecode/math/457634/FingerprintDemo/fingerprint/ftr%20scanner/ftrScanAPI.h__.htm
It is not in C# but it will give an idea
I am trying to inject a C++ detour dll using a C# application using Syringe.
Here is what I have so far:
-A dll to inject which hook both recv/send from wsock32.dll and log the communication (http://pastebin.com/JvnmYuz0)
-A C++ loader which start the target application then load the dll to it ( pastebin . com/mX68nTnx) //Sorry, I cant post more than 2 links
-A C# app that inject the dll in any process (http://pastebin.com/FLRj45YF)
But I am having some problems:
1- I do not want to use the c++ loader to start the application then inject the dll, I use it only to test the dll hooking, and it is working well, it does hook and log to file the communication
2- I want to inject the c++ dll (in any process I want) using a c# application (using Syringe). I can inject it with no problems, but it does not hook the recv/send functions as it does when started with the c++ loader, however, it says that everything was attached successfully, but it does not log anything to the file, not even call MyRecv/MySend. I once received error 8 (ERROR_NOT_ENOUGH_MEMORY) from DetourTransactionCommit() while detouring send/recv functions, but now it says there is no error
3- After being able to handle the communication using MySend/MyRecv, I want to send the communication back to the C# application then do the work there.
I am very new at c++ and dll injecting but I have some experience with c#.
It does not need to necessary use the syringe method to inject.
I have tried to use EasyHook without success.
Any injecting method will be great, as long as I can inject the dll to any process then work the communication on a C# application. I do not want to do the work on the C++ dll because I am very new to C++ and it seems to be very very hard to do simple things, the learning curve is not very friendly
thanks
PS: I do not want to hack anything/anyone, I just want to create a Ultima Online tool
I've got a problem which I hope you can help me with.
I created ASP.NET 4.0 web application. I've also got .cpp file generated in some other app. This .cpp file contains functions, which always returns the same number of variables and which always takes the same number of parameters.
What I need to do is being able to use this functions in my web application.
But what is real problem is that I need to be able to replace this functions while running app. What I mean is administrator should be able to login, upload new cpp file, which will replace old functions with new ones. New ones will have the same names, parameters and result number, but will make calculations in a different way.
Is there any way this can be achieved?
Thanks for any help!
MattheW
Precompile the cpp code into dlls and let admin upload dll. Reference dll's from c# app using [DllImport("")] directive.
C++ will need to be compiled in some way or another. You can use a compiled dll written in C++ in your ASP.NET application but the code will still need to be compiled for ASP to be able to use it.
The compiled DLL can then be loaded and unloaded to accommodate changes to the function. You could perhaps even make the ASP.NET server compile the file somehow, but the code still needs to be compileable to a DLL to make it executable.
You need to expose the C++ code via another dll.
The first choice is pinvoke. See:
How to set up a C++ function so that it can be used by p/invoke?
It's also covered here:
http://msdn.microsoft.com/en-us/library/aa446538.aspx
Technically you could also expose via COM or write in managed C++ but those are both overkill if you're just trying to expose a few C++ functions.
Ok so this is a really complicated problem, I will try my best to explain.
We have a c++ application which communicates with Sql Connection like so:
CoCreateInstance(_T("ADODB.Connection"))
This works fine.
We recently made all of our backend code into a Com Object. If I write a Vb program to load our Com Object and do some database operations everything works fine, CoCreateInstance(_T("ADODB.Connection"))
still works.
We use fitnesse for testing so I wrote a fixture that:
1) Takes a string of vb code input into an html page.
2) compiles the vb code
3) runs the vb code that uses our Com Object.
* fitnesse is a java application so the code path travels through Java as well.
Now when any operation touches the database the Com Object hits an exception. Uses message boxes, and removing code I narrowed the problem down to this line of code:
CoCreateInstance(_T("ADODB.Connection"))
normally the return code is 0, but with this chain of code calling code I get the return code: 800401F3 which says that it cannot find the object to load.
I am pulling my hair out trying to figure out whats going on. Any bit of insight would be greatly appreciated.
It is telling you that it cannot find the ProgId in the registry. That's not very healthy, it is a pretty standard component on any Windows install. Verify this, fire up regedit.exe and navigate to HKLM\Software\Classes\ADODB.Connection
If that is missing then you need to install the dbase providers on that machine. Download the MDAC 2.8 installer from Microsoft and run it. If it is not missing then you have a more mysterious problem, perhaps something to do with this being a 64-bit operating system. Look in HKLM\Software\Wow6432Node then. Get additional diagnostics by using the SysInternals' ProcMon tool to see what it is poking at in the registry.
As an alternative, you don't say whether your com "object" is a .dll. If it is, then make sure it is either "self-registering" or you'll need to run this at the command prompt.
regsvr32 myobject.dll
If it's an exe with COM objects, register the objects by running the program with the "/RegServer" command line option like this:
myobject.exe /RegServer
HTH