1
I need to use a dll provided by Bematech with functionalities of a non fiscal printer. The example they provided brings the following code:
[DllImport("MP2032.dll")]
public static extern int ConfiguraModeloImpressora(int model);
The program generates the following exception:
Additional information: An attempt has been made to upload a program with an incorrect format. (HRESULT exception: 0x8007000B)
Believing that the problem could be in dll I created a new project to generate an exportable dll. Returned the same error. I have read several posts and articles and do not understand why my code does not work.
Does the DLL used match your executable architecture? (32 or 64 bit)
– Bruno Bermann
Yes Bruno, 32 bits.
– tiago costa
Try following the suggested tip at this link (https://social.msdn.microsoft.com/Forums/pt-BR/216a765f-3082-4fd0-bdd7-b90707daa393/erro-dll-daruma) I think you can help.
– Bruno Bermann
@tiagocosta checks if your project really is in the properties -> Build -> Platform Target is x86. The times I had this problem was because of not being x86.
– Pablo Tondolo de Vargas
Thanks Bruno Bermann and Pablo Vargas, it worked.
– tiago costa