CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    18

    komunikations USMCDLL.dll

    Programme was programmed for Console Aplications where functions.
    I him remodelling to the Forms Aplications. But occurred me error plus I don't know how next.
    Thank for counsel.
    Code:
    // Motory.cpp : main project file.
    #pragma warning(disable : 4996) // Disable warnings about some functions in VS 2005
    #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

    #include <stdio.h>
    #include <tchar.h>
    #include <conio.h>
    #include <process.h>
    #include "USMCDLL.h"
    #include "stdafx.h"
    #include "Form1.h"


    [STAThreadAttribute]

    USMC_Devices DVS;
    DWORD Dev;

    using namespace System;
    using namespace Motory;

    Error:
    .\Motory.cpp(14) : error C2337: 'STAThreadAttribute' : attribute not found
    .\Motory.cpp(16) : error C2146: syntax error : missing ';' before identifier 'DVS'
    .\Motory.cpp(16) : error C2470: 'USMC_Devices' : looks like a function definition, but there is no parameter list; skipping apparent body
    .\Motory.cpp(16) : fatal error C1004: unexpected end-of-file found

  2. #2
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: komunikations USMCDLL.dll

    Move all the #includes before #include "stdafx.h" to after it i.e.

    Code:
    #include "stdafx.h"
    
    #include <stdio.h>
    #include <tchar.h>
    #include <conio.h>
    #include <process.h>
    #include "USMCDLL.h"
    #include "Form1.h"
    
    using namespace System;
    using namespace Motory;
    
    // it's possible that USMC_Devices is part of the Motory namespace, so move it to after the using namespace
    USMC_Devices DVS;
    DWORD Dev;
    Also remove the [STAThreadAttribute].

    I'm of course guessing here, but try the above :

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  3. #3
    Join Date
    Jun 2009
    Posts
    18

    Thumbs up Re: komunikations USMCDLL.dll

    Thanks, that was it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured