Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:33:47+00:00 2026-06-03T06:33:47+00:00

I’m trying to compile This Example for unmanaged export in XE but I getting

  • 0

I’m trying to compile This Example for unmanaged export in XE but I getting (PE9) Unknown identifier “UnmanagedExport” error when build.

  1. Under Compatibility select “Allow unsafe code”
  2. Under Build, find the General Section and change CPU Type to “x86”
  3. Right Click on the “ClassLibraryX” tab that was created and select “Save selected Items”
namespace exptest;

interface
    uses
      System.Runtime.InteropServices;

type
  clstest = public static class
  private
  protected
  public

     [UnmanagedExport('xmsg',CallingConvention.StdCall)]
      function xmsg(amsg : String):String;
  end;

implementation

    function clstest.xmsg(amsg: String):String;
    Begin
        Result := amsg + ' mesajı için geri dönüş';
    end;



end.

Error Window

Any idea?

@David:Thanks for answer. I’ve tried your tip

public

     [UnmanagedExport('xmsg',CallingConvention.StdCall)]
      class method xmsg(amsg : String):String;
  end;

implementation

    class method clstest.xmsg(amsg: String):String;
    Begin
        Result := amsg + ' mesajı için geri dönüş';
    end;

but same error is continues.

@David 2 :):

I’ve changed code in this way:

namespace exptest;

interface
    uses
      RemObjects.Oxygene.System;

type
  clstest = public class
  private
  protected
  public

     [UnmanagedExport('xmsg',CallingConvention.StdCall)]
      class method xmsg(amsg : String):String;
  end;

implementation

    class method clstest.xmsg(amsg: String):String;
    Begin
        Result := amsg + ' mesajı için geri dönüş';
    end;



end.

Same error 🙂

@david 3

namespace exptest;

interface
    uses
      RemObjects.Oxygene.System,System.Runtime.InteropServices;


type
  clstest = public class
  private
  protected
  public

     [UnmanagedExport('xmsg',CallingConvention.StdCall)]
      class method xmsg(amsg : String):String;
  end;

implementation

    class method clstest.xmsg(amsg: String):String;
    Begin
        Result := 'a return value for '+amsg ;
    end;



end.

still same error. :,(
Can you try on your prism ide my sample project for me please? Thanks for answers.

    C:\Program Files\Embarcadero\Delphi Prism\bin>oxygene -version
RemObjects Oxygene for .NET - Version 4.0.25.791
Copyright RemObjects Software 2003-2009. All rights reserved.
Exclusively licensed for Delphi Prism.

  Configuration Release not found

my oxygene version 4.0.25.791 I suppose.

…………………………

@David: I tried compile on command line too. here is results

C:\Documents and Settings\XPMUser\Desktop\exptest\exptest>oxygene /allowunsafe:y
es /type:library /cputype:x86 clstest.pas
RemObjects Oxygene for .NET - Version 4.0.25.791
Copyright RemObjects Software 2003-2009. All rights reserved.
Exclusively licensed for Delphi Prism.

  Preparing resources...
  Compiling...
  C:\Documents and Settings\XPMUser\Desktop\exptest\exptest\clstest.pas(14,22) :
 Error : (PE9) Unknown identifier "UnmanagedExport"

  Exiting with 1.

C:\Documents and Settings\XPMUser\Desktop\exptest\exptest>

probably your right. maybe something wrong with my compiler. But i didnt see any error during install Delphi prism.

@Rudy: I was tried VS2010 ide before this. As I Said. Maybe i reinstall delphi prism or try different machine. I’ll write results if solve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:33:48+00:00Added an answer on June 3, 2026 at 6:33 am

    I Solved problem this way.
    RGiesecke.DllExport

    using System;
    using System.Collections.Generic;
    using System.Text;
    using RGiesecke.DllExport;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Windows.Forms;
    using System.Configuration;
    
    
    namespace thenamespace
    {
    
       {
    
          private static some_members
          ...
          ...
          ...
    
          [DllExport(CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]
          [return: MarshalAs(UnmanagedType.LPStr)]
          static String GetValue(
              [MarshalAs(UnmanagedType.LPStr)] String _url,
              [MarshalAs(UnmanagedType.LPStr)] String _username,
              [MarshalAs(UnmanagedType.LPStr)] String _password, 
              int _method,
              [MarshalAs(UnmanagedType.LPStr)] String _identid,
              int _isTestMode,
              int _TimeOutAsSecond,
              [MarshalAs(UnmanagedType.LPStr)] String _ProxyAddr,
              [MarshalAs(UnmanagedType.LPStr)] String _ProxyUsername,
              [MarshalAs(UnmanagedType.LPStr)] String _ProxyPassword)
          {
            ...
             return result;
          }
    
    
    
       }
    }
    

    And pascal side

    _fGetValue = function(_url, _username, _password: pAnsiChar; _method: Integer;
        _identid: pAnsiChar; _isTestMode : Integer; _TimeOutAsSecond:Integer;
        _ProxyAddr:PAnsiChar;_ProxyUsername:PAnsiChar;_ProxyPassword:PAnsiChar): pAnsiChar; stdcall;
    
    
    ...
    ...
    ...
    
    var
      dllHandle: cardinal;
      dllFunc: _fGetValue;
    
      __url, __username, __password, __tckimlik, __result: pAnsiChar;
      __metod: Integer;__ProxyAddr:PAnsiChar;
      __ProxyUsername:PAnsiChar;__ProxyPassword:PAnsiChar;
    begin
      Result := '';
      __result := '';
    
      dllHandle := LoadLibrary('thelib.dll');
      If dllHandle <> 0 then
      begin
        dllFunc := nil;
        @dllFunc := GetProcAddress(dllHandle, 'GetValue');
    
        if Assigned(dllFunc) then
          __result := dllFunc(__url, __username, __password, __metod, __identid,
          _isTestMode,_TimeOutAsSecond,__ProxyAddr,__ProxyUsername,__ProxyPassword)
        else
        Begin
          raise Exception.Create('Method is not found');
        End;
        Result := __result;
        FreeLibrary(dllHandle);
      end
    else
    begin
      raise Exception.Create('Library not found thelib.dll');
    end;
    end;    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.