Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Linking to a .net DLL ?
Re: Linking to a .net DLL ? [message #61558 is a reply to message #33398] Mon, 17 March 2025 14:25 Go to previous messageGo to previous message
JeyCi is currently offline  JeyCi
Messages: 69
Registered: July 2020
Member
Why compiling similar example, - getting
error: 'Dl' was not declared in this scope

though I have done everything like here, but cannot declare Dl Plugin; object in Upp CONSOLE_APP_MAIN.

p.s.
Details: using upp-v.13664 x32, in Console Project (with Core package in package organizer).
DLL was made from C#.NET-source:
using System;
using System.IO;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;

namespace Plugins
{
    public class Plugins
    {   // CallingConvention.StdCall
        [DllExport("OnPluginStart", CallingConvention = CallingConvention.Cdecl)]
        public static bool OnPluginStart()
        {				
            using (var file = new StreamWriter(@"c:\\pluginLog.txt", true))
            {
                file.WriteLine("OnPluginStart");
            }			
	    return true;
        }
    }
}

compiled with CMD Line:
Quote:
C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe /t:library /platform:x86 /r:C:\Test\UnmanagedExports\lib\net\RGiesecke.DllExport.Meta data.dll /out:C:\Plugins.dll C:\Plugins.cs


MY .dli
FN(bool, OnPluginStart,(void))


Another problem, In Upp CONSOLE_APP_MAIN with
	
	bool nn= PLUGINS().Load();
	Cout() << nn << '\n';

- getting false.
And with
bool retval= PLUGINS().Load("C:\\Plugins.dll");

- Upp CONSOLE_APP_MAIN crashes

P.P.S.
Sorry, if am not right posting to this topic - just my problem seemed to be simply another problem under the same title...


Best regards.

[Updated on: Mon, 17 March 2025 19:56]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rendering is different in native and cross-compiled apps
Goto Forum:
  


Current Time: Fri Jun 06 12:18:51 CEST 2025

Total time taken to generate the page: 0.04994 seconds