Delphi.NET loading Delphi.Win32 Driver

Hi,

What I'm trying to do is marshal an array of cardinal (or integer) back into managed memory from a win32 dll. 
I know how to pass managed memory into a win32 dll
{code}
var aa : array of Integer;
     Buffer : IntPtr;
begin
  SetLength(aa,2);
  aa[0] := 1;
  aa[1] := 80;

  if not Supports(ExtractFilePath(Application.ExeName)+'Win32_Library\SDK_Driver.Win32.io', TypeOf(IMyFunctions), MyFunctions) then Exit; //loads the driver into memory. MyFunctions contains the method names found in the SDK_Driver.
  
  Buffer := Marshal.AllocHGlobal(2 * {Marshal.SystemDefaultCharSize}sizeof(Cardinal));
  Marshal.Copy(aa,0,Buffer, 2);//copy your array(1,80) into a intptr buffer.
  MyFunctions.TestProc(Buffer); //procedure TestProc(buffer : intptr); //This works!
{code}

Now how do you modify the buffer on the other side and return it? I imagine you have to use Marshal.PtrToStructure but how?? 
Thanks for your help.

Regards,
Braden Murphy
0
Braden
11/22/2010 12:50:38 PM
embarcadero.delphi.non-tech 5933 articles. 1 followers. Follow

1 Replies
1013 Views

Similar Articles

[PageSpeed] 18

<Braden Murphy> wrote in message news:307659@forums.embarcadero.com...
>
> What I'm trying to do is marshal an array of cardinal (or integer).....

Please use one of the technical groups for technical questions.
0
Uffe
11/22/2010 4:35:41 PM
Reply:

Similar Artilces:

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

delphi Win32 using delphi .NET dll
Hi, I'm trying to use a delphi.NET dll in delphi.WIN32. I am currently using CodeGear Delphi 2007 with version2(base version) of .NET I can get the dll to import into the WIN32 application the only problem is when i include things such as: "using Classes,DateUtils, SysUtils" in the .NET dll the win32 application will instantly hang when any of the dll functions are called. Any help would be great thanks. Also I have tried this example and it also crashes for me? http://cc.embarcadero.com/Item/22688 -Braden I also found this.. "The problem is that, wehn you instal...

Converting Delphi for Win32 to Delphi .Net(Prism)
Hi, I am currently migrating a project from Delphi for Win32 to Delphi.net. Part of my code currently goes into a directory and pulls out a random file from this directory and loads the contents of the file for me. This code doesn't seem to work in Delphi.Net. It uses PString and a number of functions in SysUtils that don't seem to be present in Delphi.net's SysUtils file. If anyone can help me please, it would be greatly appreciated! Many thanks, Jonathan Mackey Jonathan Mackey a écrit : > I am currently migrating a project from Delphi for Win32 to &...

converting delphi code to delphi .NET
Hi,I'm looking at converting quite a bit of old delphi code to delphi .NET .  I'm wondering can it be converted to VB.NET for certain ?  Or perhaps there are some unsupported functions etc in delphi and I should keep the code delphi ?  There are about 10,000 lines of code.   Anyone brave enough to take an estimate on how long it would take to convert 10,000 lines ?is going from delphi to delphi.NET smooth ?   Would going to another language cause complications ?Thanks! mike123   Mike123,   Sorry I can not help, however, I have the s...

Api to skydrive delphi or delphi.net
Dear Good afternoon ... Does anyone have any idea or some documentation on how to implement or delphi.net via delphi api to access skydrive files. Thank you for your help. ...

Migrate from Delphi 2007 for Win32 to Delphi XE
we use Delphi 2007 for Win32 to support legacy (32Bit) OWL-based pascal applications (yes i know it was a mistake not to switch to VCL 15 years ago). could our applications still be opened and compiled with Delphi XE? The existing projects are all plain Pascal-Code, coming back from the times of Turbo Pascal for Windows and later on Borland Pascal. Are there any improvements we could profit from (i.e IDE, Debugger)? Thanks Andrej > {quote:title=Andrej Dimic wrote:}{quote} > could our applications still be opened and compiled with Delphi XE? I'm not sure, but I guess ...

delphi.Net Delphi 2005 Project Upgrades?
Our company aquired the software property from another last year. Most of the projects were written in Delphi 2007. We purchased Delphi XE which gave us access to previous versions, including D 2007... all is well. However, 3 projects were written Delphi 2005 for .Net. The VM we received from this company included D2005 but it was licensed from the previous developer. I've contacted Embarcadero about obtaining a copy and or a license+registration for Delphi 2005 and was told this product is no longer available. I'm under the impression Delphi for .Net was abandoned. My qu...

I have Delphi 2010 which includes c++, but it always loads as Delphi
Hi there, I have Delphi 2010 which includes c++, but it always loads as Delphi. How do I forced to load as c++? Thanks for the help Jorge <Jorge Uriarte> wrote in message news:393178@forums.embarcadero.com... > I have Delphi 2010 which includes c++, but it always loads as Delphi. How > do I forced to load as c++? Did you actually install the C++ personality? Are you loading the IDE using the "Delphi 2010" shortcut (which loads bds.exe with the "-pDelphi" command line parameter)? You should be using the "C++Builder 2010" shortcut (...

Win32 program: Delphi 7 vs Delphi XE5
How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability and performance? Is Delphi XE5 good enough for a big ERP project with several DLL's and hundreds of units and forms? Thanks in advance Am 26.12.2013 15:02, schrieb lior ilan: > How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability > and performance? > Is Delphi XE5 good enough for a big ERP project with several DLL's and > hundreds of units and forms? > Thanks in advance > Hello, XE5 has increased functionality. Stability seems to be ok for most ...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi for PHP or Delphi PRISM
Hi, I have the opportunity to develop a web-based library management system. Nothing fancy, just being able to do the usual CRUD stuff for books and provide a search facility. Borrowing is to be done via an email request to the library admin who then sends out the book(s). Since both Delphi for PHP and Delphi PRISM will enable me to develop the app, which one will allow me to deliver it in less time and also increase (even how small) my marketability as a web developer? Thanks. Phillip Flores Phillip Flores wrote: > Hi, > > I have the opportunity to develop a...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Delphi 4 to Delphi 2009
Hello, Thanks to all who answered my previous question. That was a great help. And atlast our client agreed to upgrade our delphi version from 4 to Delphi 2009. *Sigh*. But before that, I need to give the estimation and cost regarding the migration to delphi 2009. Can anyone tell me is there any tool to migrate from delphi 4 to delphi 2009 or just I need to compile our Delphi 4 application in Delphi 2009. I have read from the delphi 2009 feature matrix that Delphi 1 through Delphi 2007 import is possible in delphi 2009. But i am not that sure considering the size of our application. ...

Web resources about - Delphi.NET loading Delphi.Win32 Driver - embarcadero.delphi.non-tech

Loading gauge - Wikipedia, the free encyclopedia
The loading gauge determines the sizes of passenger trains and the size of shipping containers that can be conveyed on a section of railway line ...

Facebook Adds Mobile Reach Data To Insights, Cuts Back Loading Of Organic Stories
Facebook announced two changes to its insights Tuesday: the inclusion of mobile reach data, and the lowering of the number of organic stories ...

Facebook’s Fast-Loading and Free “0″ Mobile Site Launches
More than a quarter of Facebook’s users are accessing it through mobile devices every month, and the number of mobile useres is growing fast. ...

Search Twitter - witcher 3 loading
... are using an old version of Internet Explorer. Learn more here Search Refresh WCCFtech @ wccftechdotcom 31m The Witcher 3 Experiencing Loading ...

Gmail : Why does "?shva=1" get appended to the URL when loading Gmail?
Answer: "shva" is an acronym for "should have valid authentication"

Shovel excavator loading the sewage sludge - Flickr - Photo Sharing!
This shovel excavator is loading the solid sewage sludge into the lorry distributing the sludge in the field.

Shark Kage - The Multifunctional Aluminum Loading Truck Ramp - YouTube
Shark Kage TM is the hottest ramp innovation in decades! The first of its kind MULTI-USE RAMP for your pickup truck, Shark Kage is a much needed, ...

Ferrier off-loading sandstone landmark
Title Deeds :The Bilgola property remodelled by Iain Halliday is expected to set a new non-waterfront record.

Australian navy turns back asylum seeker boat to Indonesia after loading three extra people
The asylum seeker boat that allegedly deterred Tony Abbott from meeting president Susilo Bambang Yudhoyono this week has been found in Indonesia ...

Google announces service to speed loading of news articles
Google shows off initiative to ensure news articles load more quickly on the web, but one name was conspicuously absent from the presentation. ...

Resources last updated: 11/29/2015 11:36:45 AM