Search Results

Search found 3 results on 1 pages for 'jmucchiello'.

Page 1/1 | 1 

  • Can a CWinApp be placed in a DLL?

    - by jmucchiello
    I'm updating some legacy apps to Visual Studio 10 and am in linker hell. All of these DLLs derive classes from CWinApp and use AfxGetApp() to get access to the object. When I link the DLLs I get unresolved externals that look like global static objects that would get pulled in by a normal app's main(): Shell.lib(SHELL.obj) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CException::classCException" (?classCException@CException@@2UCRuntimeClass@@B) Shell.lib(SHELL.obj) : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CFrameWnd::classCFrameWnd" (?classCFrameWnd@CFrameWnd@@2UCRuntimeClass@@B) Shell.lib(SHELL.obj) : error LNK2001: unresolved external symbol "public: static class CRect const CFrameWnd::rectDefault" (?rectDefault@CFrameWnd@@2VCRect@@B) My current combination of ignore default libraries and additional libraries (the method you can easily google to find the answer to linker hell) is: msvcprtd.lib,mfc100d.lib,mfcs100d.lib,libcmtd.lib When I add nafxcwd.lib (the mfc library), these three external symbols resolve but I end up with a bunch of other duplicate symbols (requiring the use of /FORCE:MULTIPLE) and in end __argc and __argv become unresolved. So the basic question is: Can you link a DLL containing a CWinApp in VS10? How do you setup the linker to do it?

    Read the article

  • Adding a new target type to msbuild: How do I refer to the itemname in the task rules?

    - by jmucchiello
    I'm trying to add a task to build the COM proxy DLL after building the main DLL. So I created the following in a .target file: <Target Name="ProxyDLL" Inputs="$(IntDir)%(WHATGOESHERE)_i.c;$(IntDir)dlldata.c" Outputs="$(OutDir)%(WHATGOESHERE)ps.dll" AfterTargets="Link"> <CL Sources="$(IntDir)%(WHATGOESHERE)_i.c;$(IntDir)dlldata.c" /> </Target> And reference it from the .vcxproj file as <ItemGroup> <ProxyDLL Include="FTAccountant" /> </ItemGroup> So the FTAccountant.DLL file is created through the normal build process and then when attempts to compile the proxy stubs it creates these command lines: cl /c dir\_i.c dir\dlldata.c And of course it can't find _i.c. The first attempt, I put %(Filename) in the WHATGOESHERE space and I got this error: C:\ActivePay\Build\Proxy DLL.targets(6,3): error MSB4095: The item metadata %(Filename) is being referenced without an item name. Specify the item name by using %(itemname.Filename). So I changed it to %(itemname.Filename) and that is an empty string. How to get the value specified in the task's Include attribute and use it within the task?

    Read the article

  • [Embedded Python] Invoking a method on an object

    - by jmucchiello
    Given a PyObject* pointing to a python object, how do I invoke one of the object methods? The documentation never gives an example of this: PyObject* obj = .... PyObject* args = Py_BuildValue("(s)", "An arg"); PyObject* method = PyWHATGOESHERE(obj, "foo"); PyObject* ret = PyWHATGOESHERE(obj, method, args); if (!ret) { // check error... } This would be the equivalent of >>> ret = obj.foo("An arg")

    Read the article

1