|
|
I have to create a simple appliction
that will have to send & receive data
from the USB port .
Can anyone help ??
Thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I think you can use the directory routines "_getdrives();" to visit the drives and its subfolder and a basic copy function to write or read data
|
|
|
|
|
Thank you
Its like this that we have created a small
Serial to USB converter ,
I just want to send some data & receive some
data from the USB port .
Thats it....
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi Folks,
I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this
worked fine. When moving to .NET 2.0 I get a couple of unresolved externals /
linker errors:
Error 16 error LNK2028: unresolved token (0A000007) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??1logic_error@std@@$$FUAE@XZ) Parameter.obj
Error 17 error LNK2028: unresolved token (0A000007) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public:
__thiscall std::bad_alloc::bad_alloc(char const *)"
(??0bad_alloc@std@@$$FQAE@PBD@Z) Imagic.obj
Error 18 error LNK2028: unresolved token (0A000008) "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??1logic_error@std@@$$FUAE@XZ) Align2D.obj
Error 19 error LNK2028: unresolved token (0A000347) "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) referenced in function "public: virtual void
* __thiscall std::logic_error::`vector deleting destructor'(unsigned int)"
(??_Elogic_error@std@@$$FUAEPAXI@Z) Parameter.obj
Error 20 error LNK2028: unresolved token (0A0003D3) "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) referenced in function "public: virtual void
* __thiscall std::bad_alloc::`vector deleting destructor'(unsigned int)"
(??_Ebad_alloc@std@@$$FUAEPAXI@Z) Imagic.obj
Error 21 error LNK2028: unresolved token (0A000358) "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) referenced in function "public: virtual void
* __thiscall std::logic_error::`vector deleting destructor'(unsigned int)"
(??_Elogic_error@std@@$$FUAEPAXI@Z) Align2D.obj
Error 22 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ) Align2D.obj
Error 23 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ) AssemblyInfo.obj
Error 24 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ) Imagic.obj
Error 25 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ) Parameter.obj
Error 26 error LNK2019: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public:
virtual __thiscall std::logic_error::~logic_error(void)"
(??1logic_error@std@@$$FUAE@XZ) Align2D.obj
Error 27 error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) Imagic.obj
Error 28 error LNK2001: unresolved external symbol "extern "C" void
__clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)"
(?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) Parameter.obj
Error 29 error LNK2019: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) referenced in function "public: virtual void
* __thiscall std::logic_error::`vector deleting destructor'(unsigned int)"
(??_Elogic_error@std@@$$FUAEPAXI@Z) Align2D.obj
Error 30 error LNK2001: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) Imagic.obj
Error 31 error LNK2001: unresolved external symbol "void __clrcall `eh
vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void
*))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) Parameter.obj
Error 32 fatal error LNK1120: 9 unresolved externals Debug\empDll.dll
In my .NET 1.1 Project I had to make the following Linker Settings to build
the DLL:
1.) Additional Dependencies: mscoree.lib msvcrt.lib (or msvcrtd.lib for
debug version) mystaticlib.lib
2.) Ignore Specific Library: nochkclr.obj
3.) Force Symbol Reference: __DllMainCRTStartup@12
In my Wrapper Classes I had to add the following:
#using <mscorlib.dll>
using namespace System;
using namespace System::Runtime::InteropServices;
This does not work any longer with the new Visual Studio and the new .NET
Framework.
The only article that I was able to find on this subject:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/TransGuide.asp
Doesn´t mention Linker settings at all.
Could anybody please help me or tell me where to go for further reading?
Thanks in Advance for your efforts.
Chucker
|
|
|
|
|
Did you try adding msvcmrt.lib to the Additional Dependencies section?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Now I tried it and it resolved the unresolved externals! Thanks for this hint!
Unfortunately this did not solve the whole problem. Now I get the following BadImageFormatException:
System.BadImageFormatException was unhandled
Message="Could not load file or assembly 'empDll, Version=1.6.0.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."
Source="empDllTest"
FileName="empDll, Version=1.6.0.1, Culture=neutral, PublicKeyToken=null"
FusionLog="=== Pre-bind state information ===\r\nLOG: User = MPG-BPC\\mschmei\r\nLOG: DisplayName = empDll, Version=1.6.0.1, Culture=neutral, PublicKeyToken=null\n (Fully-specified)\r\nLOG: Appbase = file:///D:/empRemoting2/Release/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : empDllTest, Version=1.0.2134.28533, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: No application configuration file found.\r\nLOG: Using machine configuration file from C:\\WINDOWS\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config.\r\nLOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).\r\nLOG: Attempting download of new URL file:///D:/empRemoting2/Release/empDll.DLL.\r\nERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.\r\n"
StackTrace:
at empDllTest.DllTester.Main(String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
|
|
|
Oooops, this was my fault now. It was a 64 Bit issue. In 32 Bit everything is fine now! ) Thanks alot! Chucker
|
|
|
|
|
Is that a pure managed DLL or a mixed-mode DLL? How are you loading the DLL, directly or via reflection?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
It is mixed mode and I just have to recompile the static libs in 64 Bit Mode or obtain the 64 Bit Versions of the static libs. I think I will get this done now! Thanks a lot Chucker
|
|
|
|
|
Hi all ,
could someone explain what is the diffrent between this contructor
_bstr_t(
BSTR bstr,
bool fCopy
);
and this
_bstr_t(
const _bstr_t& s1
) throw( );
Do I have to free one of these afte use ?
Do i habe to the BSTR (for the first example) ?
Thanks very much
|
|
|
|
|
The second one is the copy constructor for _bstr_t. No, you don't need to do any SysFreeString, _bstr_t takes care of it when the destructor runs.
The first constructor, AFAIK, copies or "attaches" the BSTR to the _bstr_t instance, depending on the fCopy parameter. If you pass true, you need to SysFreeString the BSTR yourself.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
In the first ctor, if you pass FALSE for fCopy , the _bstr_t object takes ownership of the BSTR that you pass as the first parameter. If you pass TRUE , it does not, but instead makes a copy of the BSTR , which it then manages.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hi
Do any one knows the use of
a Smart Pointer?
what is exactly a smart pointer?
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
"Speed is the Key to success"
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
|
Also take a look at the Boost smart pointers[^]
Note that shared pointers will become part of the C++ standard as they are included in TR1[^] - coming to a compiler near you, soon(er or later)
Edit: qfegd beat me to it , but he didn't get the link to TR1
P.S. how do you pronounce qfegd?
Graham
-- modified at 9:38 Friday 4th November, 2005
|
|
|
|
|
sorry sir, my finger slided too fast on my mouse button, and i unvoluntarily voted you down... all appologies
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote: sorry sir, my finger slided too fast on my mouse button, and i unvoluntarily voted you down...
No worries, mate
|
|
|
|
|
toxcct wrote: sorry sir, my finger slided too fast on my mouse button, and i unvoluntarily voted you down... all appologies
No worries! I voted 5 on your Behalf !
"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
|
|
|
|
|
qfegd = quo fas et gloria ducunt
|
|
|
|
|
qfegd wrote: qfegd = quo fas et gloria ducunt
sorry, i don't speak latin regularly this means ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
it mean:
Everywhere you go, glory will follow
Premature optimization is the root of all evil
|
|
|
|