473,804 Members | 3,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOWTO Implement LoadLibrary, GetProcAdress, and FreeLibrary.

ATS
HOWTO Implement LoadLibrary, GetProcAdress, and FreeLibrary.

Below is code that I want to be able to use simple
LoadLibrary\Get ProcAddress\Fre eLibrary technqiues on. I've used the code that
was initially placed on the .NET 247 forum as such:

http://dotnet247.com/247reference//msgs/28/140461.aspx

I have expanded it here to let one call any/all kinds of functions. The idea
is that a "MASTER" Invoke function takes arrays that explain everything
needed to be able to call functionality as one desires, while overloaded
version of "Invoke" that are prepped for the means\design we wish to cal them
as build the arrays as need be. If anyone would please, help me fill in the
blanks as denoted by the various "????" spots.

=============== =====

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Drawing;
using System.Data;
using System.Windows. Forms;
using System.IO;
using System.Net;
using System.Reflecti on;
using System.Reflecti on.Emit;
using System.Runtime. InteropServices ;

namespace MyNameSpace
{
public class MyClass
{
[DllImport("kern el32.dll")]
static extern IntPtr LoadLibrary(str ing csFileName);

[DllImport("kern el32.dll")]
static extern IntPtr GetProcAddress( IntPtr IntPtr_Module, string
csProcName);

[DllImport("kern el32.dll")]
static extern bool FreeLibrary(Int Ptr IntPtr_Module);

public main()
{
IntPtr IntPtr_MyLib = LoadLibrary("My Lib.dll");
IntPtr IntPtr_MyFunc = GetProcAddress( IntPtr_MyLib, "MyFunc");
string csRET = Invoke(IntPtr_M yFunc, "Param #1", "Param #2");
FreeLibrary(Int Ptr_MyFunc);
}

public static string Invoke(IntPtr IntPtr_Function , string csParam1,
string csParam2)
{
object[] zobject_Paramet ers = new object[]
{
csParam1,
csParam2
};
Type[] zType_Parameter Types = new Type[]
{
typeof(string),
typeof(string)
};
String[] zcsParameterTyp es = new String[]
{
"string",
"string"
};

Type Type_Return = typeof(string);
return (string) Invoke
(
IntPtr_Function ,
zobject_Paramet ers,
zType_Parameter Types,
zcsParameterTyp es,
Type_Return
);
}

public static object Invoke
(
IntPtr IntPtr_Function ,
object[] zobject_Paramet ers,
Type[] zType_Parameter Types,
String[] zcsParameterTyp es,
Type Type_Return
)
{
AssemblyName AssemblyName_Th is = new AssemblyName();
AssemblyName_Th is.Name = "Invokable" ;
AssemblyBuilder AssemblyBuilder _This =
AppDomain.Curre ntDomain.Define DynamicAssembly
(
AssemblyName_Th is,
AssemblyBuilder Access.Run
);
ModuleBuilder ModuleBuilder_T his =
AssemblyBuilder _This.DefineDyn amicModule
(
"CInvoker"
);

MethodBuilder MethodBuilder_T his = ModuleBuilder_T his.DefineGloba lMethod
(
"Invoker",
MethodAttribute s.Public | MethodAttribute s.Static,
Type_Return,
zType_Parameter Types
);

ILGenerator ILGenerator_Thi s = MethodBuilder_T his.GetILGenera tor();

int i;
OpCode OpCode_Integer;

if (IntPtr.Size == 4)
{
OpCode_Integer = OpCodes.Ldc_I4;
}
else if (IntPtr.Size == 8)
{
OpCode_Integer = OpCodes.Ldc_I8;
}
else
{
throw new PlatformNotSupp ortedException( );
}

for (i = 0; i < zobject_Paramet ers.Length; i++)
{
switch (zcsParameterTy pes[i])
{
case "sbyte":
ILGenerator_Thi s.Emit(????, (sbyte) zobject_Paramet ers[i]);
break;
case "byte":
ILGenerator_Thi s.Emit(????, (byte) zobject_Paramet ers[i]);
break;
case "char":
ILGenerator_Thi s.Emit(????, (char) zobject_Paramet ers[i]);
break;
case "short":
ILGenerator_Thi s.Emit(????, (short) zobject_Paramet ers[i]);
break;
case "ushort":
ILGenerator_Thi s.Emit(????, (ushort) zobject_Paramet ers[i]);
break;
case "int":
ILGenerator_Thi s.Emit(OpCode_I nteger, (int)
zobject_Paramet ers[i]);
break;
case "uint":
ILGenerator_Thi s.Emit(OpCode_I nteger, (uint)
zobject_Paramet ers[i]);
break;
case "long":
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, (long)
zobject_Paramet ers[i]);
break;
case "ulong":
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, (ulong)
zobject_Paramet ers[i]);
break;
case "float":
ILGenerator_Thi s.Emit(OpCodes. Ldc_R4, (float)
zobject_Paramet ers[i]);
break;
case "double":
ILGenerator_Thi s.Emit(OpCodes. Ldc_R8, (double)
zobject_Paramet ers[i]);
break;
case "string":
ILGenerator_Thi s.Emit(????OpCo des.Ldstr, (string)
zobject_Paramet ers[i]);
break;
case "StringBuilder" :
ILGenerator_Thi s.Emit(????OpCo des.Ldstr, (StringBuilder)
zobject_Paramet ers[i]);
break;
default:
throw
(
new Exception
(
"The parameter #" + i.ToString() + " is not a valid type for
invocation"
)
);
break;
}
}

ILGenerator_Thi s.EmitCalli
(
OpCodes.Calli,
CallingConventi on.StdCall,
Type_Return,
zType_Parameter s
);
ILGenerator_Thi s.Emit(OpCodes. Ret);

ModuleBuilder_T his.CreateGloba lFunctions();
MethodInfo MethodInfo_This = ModuleBuilder_T his.GetMethod(" Invoker");
return MethodInfo_This .Invoke(null, zobject_Paramet ers);
}
}
}

Nov 17 '05 #1
3 6508
ATS
I forgot to add some code to the "Invoke" function as such:
public static object Invoke
(
IntPtr IntPtr_Function ,
object[] zobject_Paramet ers,
Type[] zType_Parameter Types,
String[] zcsParameterTyp es,
Type Type_Return
)
{
// To begin, we will setup a temporary assembly, module, and method
which we will use JIT
// technqiues to build, that will call our desired function.

AssemblyName AssemblyName_Th is = new AssemblyName();
AssemblyName_Th is.Name = "Invokable" ;
AssemblyBuilder AssemblyBuilder _This =
AppDomain.Curre ntDomain.Define DynamicAssembly
(
AssemblyName_Th is,
AssemblyBuilder Access.Run
);
ModuleBuilder ModuleBuilder_T his =
AssemblyBuilder _This.DefineDyn amicModule
(
"CInvoker"
);

MethodBuilder MethodBuilder_T his = ModuleBuilder_T his.DefineGloba lMethod
(
"Invoker",
MethodAttribute s.Public | MethodAttribute s.Static,
Type_Return,
zType_Parameter Types
);

ILGenerator ILGenerator_Thi s = MethodBuilder_T his.GetILGenera tor();

int i;
OpCode OpCode_Integer;

// We must now push each paramter onto the stack.

if (IntPtr.Size == 4)
{
OpCode_Integer = OpCodes.Ldc_I4;
}
else if (IntPtr.Size == 8)
{
OpCode_Integer = OpCodes.Ldc_I8;
}
else
{
throw new PlatformNotSupp ortedException( );
}

for (i = 0; i < zobject_Paramet ers.Length; i++)
{
switch (zcsParameterTy pes[i])
{
case "sbyte":
ILGenerator_Thi s.Emit(????, (sbyte) zobject_Paramet ers[i]);
break;
case "byte":
ILGenerator_Thi s.Emit(????, (byte) zobject_Paramet ers[i]);
break;
case "char":
ILGenerator_Thi s.Emit(????, (char) zobject_Paramet ers[i]);
break;
case "short":
ILGenerator_Thi s.Emit(????, (short) zobject_Paramet ers[i]);
break;
case "ushort":
ILGenerator_Thi s.Emit(????, (ushort) zobject_Paramet ers[i]);
break;
case "int":
ILGenerator_Thi s.Emit(OpCode_I nteger, (int)
zobject_Paramet ers[i]);
break;
case "uint":
ILGenerator_Thi s.Emit(OpCode_I nteger, (uint)
zobject_Paramet ers[i]);
break;
case "long":
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, (long)
zobject_Paramet ers[i]);
break;
case "ulong":
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, (ulong)
zobject_Paramet ers[i]);
break;
case "float":
ILGenerator_Thi s.Emit(OpCodes. Ldc_R4, (float)
zobject_Paramet ers[i]);
break;
case "double":
ILGenerator_Thi s.Emit(OpCodes. Ldc_R8, (double)
zobject_Paramet ers[i]);
break;
case "string":
ILGenerator_Thi s.Emit(????OpCo des.Ldstr, (string)
zobject_Paramet ers[i]);
break;
case "StringBuilder" :
ILGenerator_Thi s.Emit(????OpCo des.Ldstr, (StringBuilder)
zobject_Paramet ers[i]);
break;
default:
throw
(
new Exception
(
"The parameter #" + i.ToString() + " is not a valid type for
invocation"
)
);
break;
}
}

// We must now push the function pointer onto the stack.

if (IntPtr.Size == 4)
{
ILGenerator_Thi s.Emit(OpCode_I nteger, IntPtr_Function .ToInt32());
}
else if (IntPtr.Size == 8)
{
ILGenerator_Thi s.Emit(OpCode_I nteger, IntPtr_Function .ToInt64());
}
else
{
throw new PlatformNotSupp ortedException( );
}

// Now we pop the parameters, and the function from the stack, which
makes the call to the
// function. After which, we push the return type onto the stack.

ILGenerator_Thi s.EmitCalli
(
OpCodes.Calli,
CallingConventi on.StdCall,
Type_Return,
zType_Parameter s
);
ILGenerator_Thi s.Emit(OpCodes. Ret);

// At this point, out code for the JIT is ready. We now need to
actually call it, and
// return its results.

ModuleBuilder_T his.CreateGloba lFunctions();
MethodInfo MethodInfo_This = ModuleBuilder_T his.GetMethod(" Invoker");
return MethodInfo_This .Invoke(null, zobject_Paramet ers);
}

Nov 17 '05 #2
This is completely the wrong way to go about this. I've already pointed
you in the direction to go if you are using .NET 2.0. If you are using .NET
1.1 and before, then you will want to create a shim in unmanaged code which
will make the call to LoadLibrary/GetProcAddress, and return a delegate to
you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"ATS" <AT*@discussion s.microsoft.com > wrote in message
news:38******** *************** ***********@mic rosoft.com...
HOWTO Implement LoadLibrary, GetProcAdress, and FreeLibrary.

Below is code that I want to be able to use simple
LoadLibrary\Get ProcAddress\Fre eLibrary technqiues on. I've used the code
that
was initially placed on the .NET 247 forum as such:

http://dotnet247.com/247reference//msgs/28/140461.aspx

I have expanded it here to let one call any/all kinds of functions. The
idea
is that a "MASTER" Invoke function takes arrays that explain everything
needed to be able to call functionality as one desires, while overloaded
version of "Invoke" that are prepped for the means\design we wish to cal
them
as build the arrays as need be. If anyone would please, help me fill in
the
blanks as denoted by the various "????" spots.

=============== =====

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Drawing;
using System.Data;
using System.Windows. Forms;
using System.IO;
using System.Net;
using System.Reflecti on;
using System.Reflecti on.Emit;
using System.Runtime. InteropServices ;

namespace MyNameSpace
{
public class MyClass
{
[DllImport("kern el32.dll")]
static extern IntPtr LoadLibrary(str ing csFileName);

[DllImport("kern el32.dll")]
static extern IntPtr GetProcAddress( IntPtr IntPtr_Module, string
csProcName);

[DllImport("kern el32.dll")]
static extern bool FreeLibrary(Int Ptr IntPtr_Module);

public main()
{
IntPtr IntPtr_MyLib = LoadLibrary("My Lib.dll");
IntPtr IntPtr_MyFunc = GetProcAddress( IntPtr_MyLib, "MyFunc");
string csRET = Invoke(IntPtr_M yFunc, "Param #1", "Param #2");
FreeLibrary(Int Ptr_MyFunc);
}

public static string Invoke(IntPtr IntPtr_Function , string csParam1,
string csParam2)
{
object[] zobject_Paramet ers = new object[]
{
csParam1,
csParam2
};
Type[] zType_Parameter Types = new Type[]
{
typeof(string),
typeof(string)
};
String[] zcsParameterTyp es = new String[]
{
"string",
"string"
};

Type Type_Return = typeof(string);
return (string) Invoke
(
IntPtr_Function ,
zobject_Paramet ers,
zType_Parameter Types,
zcsParameterTyp es,
Type_Return
);
}

public static object Invoke
(
IntPtr IntPtr_Function ,
object[] zobject_Paramet ers,
Type[] zType_Parameter Types,
String[] zcsParameterTyp es,
Type Type_Return
)
{
AssemblyName AssemblyName_Th is = new AssemblyName();
AssemblyName_Th is.Name = "Invokable" ;
AssemblyBuilder AssemblyBuilder _This =
AppDomain.Curre ntDomain.Define DynamicAssembly
(
AssemblyName_Th is,
AssemblyBuilder Access.Run
);
ModuleBuilder ModuleBuilder_T his =
AssemblyBuilder _This.DefineDyn amicModule
(
"CInvoker"
);

MethodBuilder MethodBuilder_T his =
ModuleBuilder_T his.DefineGloba lMethod
(
"Invoker",
MethodAttribute s.Public | MethodAttribute s.Static,
Type_Return,
zType_Parameter Types
);

ILGenerator ILGenerator_Thi s = MethodBuilder_T his.GetILGenera tor();

int i;
OpCode OpCode_Integer;

if (IntPtr.Size == 4)
{
OpCode_Integer = OpCodes.Ldc_I4;
}
else if (IntPtr.Size == 8)
{
OpCode_Integer = OpCodes.Ldc_I8;
}
else
{
throw new PlatformNotSupp ortedException( );
}

for (i = 0; i < zobject_Paramet ers.Length; i++)
{
switch (zcsParameterTy pes[i])
{
case "sbyte":
ILGenerator_Thi s.Emit(????, (sbyte) zobject_Paramet ers[i]);
break;
case "byte":
ILGenerator_Thi s.Emit(????, (byte) zobject_Paramet ers[i]);
break;
case "char":
ILGenerator_Thi s.Emit(????, (char) zobject_Paramet ers[i]);
break;
case "short":
ILGenerator_Thi s.Emit(????, (short) zobject_Paramet ers[i]);
break;
case "ushort":
ILGenerator_Thi s.Emit(????, (ushort) zobject_Paramet ers[i]);
break;
case "int":
ILGenerator_Thi s.Emit(OpCode_I nteger, (int)
zobject_Paramet ers[i]);
break;
case "uint":
ILGenerator_Thi s.Emit(OpCode_I nteger, (uint)
zobject_Paramet ers[i]);
break;
case "long":
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, (long)
zobject_Paramet ers[i]);
break;
case "ulong":
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, (ulong)
zobject_Paramet ers[i]);
break;
case "float":
ILGenerator_Thi s.Emit(OpCodes. Ldc_R4, (float)
zobject_Paramet ers[i]);
break;
case "double":
ILGenerator_Thi s.Emit(OpCodes. Ldc_R8, (double)
zobject_Paramet ers[i]);
break;
case "string":
ILGenerator_Thi s.Emit(????OpCo des.Ldstr, (string)
zobject_Paramet ers[i]);
break;
case "StringBuilder" :
ILGenerator_Thi s.Emit(????OpCo des.Ldstr, (StringBuilder)
zobject_Paramet ers[i]);
break;
default:
throw
(
new Exception
(
"The parameter #" + i.ToString() + " is not a valid type
for
invocation"
)
);
break;
}
}

ILGenerator_Thi s.EmitCalli
(
OpCodes.Calli,
CallingConventi on.StdCall,
Type_Return,
zType_Parameter s
);
ILGenerator_Thi s.Emit(OpCodes. Ret);

ModuleBuilder_T his.CreateGloba lFunctions();
MethodInfo MethodInfo_This = ModuleBuilder_T his.GetMethod(" Invoker");
return MethodInfo_This .Invoke(null, zobject_Paramet ers);
}
}
}

Nov 17 '05 #3
ATS
Thanks for the reply, but without having it completely spoon fed I have no
wheres to go but this approach. I need the full
LoadLibray\GetP rocAddress\Free Library, in C#. I can not use static mechanisms
to load my DLL, as the DLL will not exists until run time. And the function
prototype will not necessarily be static either. This approach was taken on
by others to basically use the JIT to FORCE C# into working with
LoadLibrary\Get ProcAddress\Fre eLibrary exactly as I need it, where both the
DLL is not know until run time, and the prototype of the function to call is
also not known until run time.

Now, for clarification, I do not need the prototype of the function to be
dynamic, I can live with using (for the moment) a hard coded prototype, so
long as the DLL is not statically coded.

By the way, I've changed the Invoke function from other posts on google as
such:

=============== ========

public static string Invoke(IntPtr IntPtr_Function , string csParam1,
string csParam2)
{
object[] zobject_Paramet ers = new object[]
{
csParam1,
csParam2
};
Type[] zType_Parameter Types = new Type[]
{
typeof(string),
typeof(string)
};
String[] zcsParameterTyp es = new String[]
{
"value",
"value"
};

Type Type_Return = typeof(string);
return (string) Invoke
(
IntPtr_Function ,
zobject_Paramet ers,
zType_Parameter Types,
zcsParameterTyp es,
Type_Return
);
}

public static object Invoke
(
IntPtr IntPtr_Function ,
object[] zobject_Paramet ers,
Type[] zType_Parameter Types,
String[] zcsParameterTyp es,
Type Type_Return
)
{
// To begin, we will setup a temporary assembly, module, and method
which we will use JIT
// technqiues to build, that will call our desired function.

AssemblyName AssemblyName_Th is = new AssemblyName();
AssemblyName_Th is.Name = "Invokable" ;
AssemblyBuilder AssemblyBuilder _This =
AppDomain.Curre ntDomain.Define DynamicAssembly
(
AssemblyName_Th is,
AssemblyBuilder Access.Run
);
ModuleBuilder ModuleBuilder_T his =
AssemblyBuilder _This.DefineDyn amicModule
(
"CInvoker"
);

MethodBuilder MethodBuilder_T his = ModuleBuilder_T his.DefineGloba lMethod
(
"Invoker",
MethodAttribute s.Public | MethodAttribute s.Static,
Type_Return,
zType_Parameter Types
);

ILGenerator ILGenerator_Thi s = MethodBuilder_T his.GetILGenera tor();

int i;

// We must now push each paramter onto the stack. As we do, we must
push them on to reflect
// whether they are static values, or references.

for (i = 1; i <= zobject_Paramet ers.Length; i++)
{
switch (zcsParameterTy pes[i - 1])
{
case "value":
ILGenerator_Thi s.Emit(OpCodes. Ldarg, i);
break;
case "address":
ILGenerator_Thi s.Emit(OpCodes. Ldarga, i);
break;
default:
throw
(
new Exception
(
"The parameter #" + i.ToString() + " does not have a valid
reference type"
)
);
}
}

// We must now push the function pointer onto the stack.

if (IntPtr.Size == 4)
{
ILGenerator_Thi s.Emit(OpCodes. Ldc_I4, IntPtr_Function .ToInt32());
}
else if (IntPtr.Size == 8)
{
ILGenerator_Thi s.Emit(OpCodes. Ldc_I8, IntPtr_Function .ToInt64());
}
else
{
throw new PlatformNotSupp ortedException( );
}

// Now we pop the parameters, and the function from the stack, which
makes the call to the
// function. After which, we push the return type onto the stack.

ILGenerator_Thi s.EmitCalli
(
OpCodes.Calli,
CallingConventi on.StdCall,
Type_Return,
zType_Parameter Types
);
ILGenerator_Thi s.Emit(OpCodes. Ret);

// At this point, out code for the JIT is ready. We now need to
actually call it, and
// return its results.

ModuleBuilder_T his.CreateGloba lFunctions();
MethodInfo MethodInfo_This = ModuleBuilder_T his.GetMethod(" Invoker");
return MethodInfo_This .Invoke(null, zobject_Paramet ers);
}

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
61183
by: Siegfried Heintze | last post by:
I have some C functions I need to expose as XML web services. My original plan was to deply an XML Web service in C# and use P/Invoke to call my C functions. This is not working because the web service cannot find the DLL in the same directory. This is probably because the DLL needs to be in a different directory, perhaps the same directory as ASP.NET or \WinNT\System32. Unfortunately, placing my DLL in these directories is not an...
8
21254
by: ATS | last post by:
HOWTO Implement LoadLibrary\GetProcAdrress\FreeLibrary in C# Please help, I want to fully implement LoadLibrary\GetProcAdrress\FreeLibrary in C#, and be able to call functions that I use GetProcAddress on to pass info to non-.NET apps. I can not use the standard "interop" process, as the DLL's are created dynamically. I need this: ========================================
3
3560
by: Sam Carleton | last post by:
I am writing Managed C++ code to call in to an Unmanaged C API. The reason for using Managed C++ over C# is that the Unmanaged C module is loaded via LoadLibrary(). DllImport cannot be used; functions pointers and GetProcAddress() is being used. The API function definition looks like this: int GetString( char* pszOutStr, int *nStrLen) It looks like the prototyping of the function pointer is straight
3
3694
by: Michael Tissington | last post by:
I'm using LoadLibrary to import a DLL in a asp.net application. The dll was written in c++ and is located in the bin folder I have been testing the website on my development machine and our inhouse webserver running IIS 5.1 and it works correctly. I'm specifing a real path to LoadLibrary of the form C:\domains\...\file.dll (obtained from MapPath)
4
2862
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. '**************************************************************************** ' Issues '****************************************************************************
0
1558
by: Benjamin | last post by:
I am attempting to create multiple itterators for a custom class that I have created. Basically I have a class that I am populating using XML de-serialization. I want to be able to loop through the class using a foreach loop. I realize that in order to do this I need to create my own GetEnumerator that implements the movenext and current methods. The problem that I have is that I have been able to implement this for only one of the classes...
4
5356
by: Bernd Muent | last post by:
Hi together, I made a DLL in the following way (simplified example just to explain what is the problem) using devcpp and gcc compiler on Windows XP: dll.h: #ifndef _DLL_H_ #define _DLL_H_ #if BUILDING_DLL # define DLLIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */
0
1545
by: man1975 | last post by:
Hi I have a dll(MFC extn dll), which complied using /CLR option. when i try to use FreeLibrary(), it never clears from memory. I know, once the .net dll is loaded, _GC will take care of the memory, but not sure when the object will be cleared from the memory. as i have to load the dll almost 10000 times within a hour, based on user request. requesting for suggestiion. HINSTANCE hDLL; // Handle to DLL hDLL =...
1
2803
by: dh | last post by:
After using Win32 FreeLibrary() to unload a DLL in a C# app, will the DLL be immediately removed from memory, or it go through the same mechanism of GC of .NET like other objects in C# code?
0
9572
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.