I want to create a .NET assembly that can be accessed from unmanaged code (Delphi 5).
I have found Unmanaged Exports and followed the steps there but I am unable to successfuly compile even the basic example:
using RGiesecke.DllExport;
namespace DelphiNET
{
public class Class1
{
[DllExport("add")]
public stati...
In a dll build with Delphi 2006
Foo(aPath: widestring);
begin
_rootPath := aPath;
end;
In an executable built with Delphi 2010
_Foo := GetProcAddress(FooModule,’Foo’);
_Foo(‘123456’);
Stepping into the dll, aPath = '123'. In fact any string I pass gets cut exactly in half.
1.) Why is my literal being halved?
2.) How do I fix it...
I'm wondering if it is possible to display topics from a CHM help file in a form of my Delphy application? I know how to use the htmlhelp api but it launches the external help viewer. I would like to display the help topics within a form
...
Here's the case. I'm trying to make a Chess engine. Not that I believe that I can make anything better than what's already out there, but I want to see how it works. I've made some of the important parts, such as board representation and the evaluation function. The evaluation function seems to produce decent results, so now I need to im...
I want to store images into a database using SQL commands, I know other ways using TBlobField.LoadFromFile etc, but we make our own sql commands to update the database that's why I need to do this.
Any suggestions / pointers to how I should go about doing this?
Sandeep
...
Hello,
I have a simple DBGrid, DBNavigator, and an 'Edit' Button which simply calls
DBNavigator.BtnClick(nbEdit);
When the user clicks 'Edit', I want the text in the selected cell (just the text - not the whole cell) to be highlighted - as if ready to be overwritten; whereas when I do
DBGid.SetFocus;
DBNavigator.BtnClick(nbEdit);...
Hi
How can I create a generic class only containing primitive types?
TField<T: xxx> = class
private
FValue: T;
public
property Value: T read FValue write FValue;
end;
I don't need interfaces, classes, etc, I only want booleans, ints, floats and so on...
Or there is another way to do that?
Thanks
...
Can somebody please post here an example how to host CLR in Delphi? I have read similar question here but I cannot use JCL as I want to host it in Delphi 5. Thank you.
EDIT: This article about hosting CLR in Fox Pro looks promising but I don't know how to access clrhost.dll from Delphi.
Edit 2: I give up on Delphi 5 requirement. No...
Hi
I'm developing a Word addin in Delphi 7, but soon I'll upgrade it to Delphi 2010, as you know, since version 2009 Delphi introduces the new string type UnicodeString which equals to the keyword string . On the other hand, according to this thread we need to use WideString to communicate with COM.
My question is, what should I do in...
I have form with MainMenu and I want to intercept when the user selects a command item from a menu.
This works in Delphi:
type
TForm1 = class(TForm)
... // Memo and MainMenu created
protected
procedure WMCommand(var Info: TWMCommand); message WM_COMMAND;
end;
procedure TForm1.WMCommand(var Info: TWMCommand);
begin
if (...
I am writing a procedure to close all adoquery created and open on a (any) form, the problem is I need to do a cast on the form to identify the components. how can I make a dynamic cast like shown in the example?
I need something like this
Procedure OpenADODataSets(Form:TForm;FormType:TClass);
...
...
(Form as FormType).ComponentCount
...
I am trying to filter some records from a TADOQuery. I set the filtered property to true and when I set the filter to field='value', all works fine. I would like to dynamically build this filter by appending
<space>AND field='value'
to a value always true, and I thought 1=1 would do the trick. So I would have 1=1 as the default filte...
I made a small app that connects to a mysql db using dbx. It works ok with my local mysql server, but it's supposed to work with a remote server.
Connecting to the remote server takes a few seconds, which freezes the app.
So my question is, how can I put the connection code in a different thread?
I'll have to pass that connection to t...
I need a way to write a generic procedure to act upon an object type or any of its descendants.
My first attempt was to declare
procedure TotalDestroy(var obj:TMyObject);
but when using it with a descendant object
type TMyNewerObject = class(TMyObject);
var someNewerObject: TMyNewerObject;
TotalDestroy(someNewerObject);
I get the...
Delphi versions before 2010 had an option in the Delphi Environment that one could set: "All v-table interfaces". This would change the calling convention when importing type libraries. In 2010, the option is gone. How do I import a type library with the safecall calling convention? I'm hoping maybe there is a more granular level of ...
How can I connect from Delphi to Sybase Sql Server? I want to be able to make querys, execute stored procedures, reference views, etc., all the things that the server allows me to do.
Are there any components (like the dbGo components) or something like that?
...
Title says it all.
Sometimes I want L-shaped, T-shaped, triangular, polygonal ...
Free reusable component please . . .
...
I have a custom Component (cut down)
TMyComponent = class(TComponent)
public
procedure ClientConnected;
published
property ClientSocket: TClientSocket Read ...etc
Right now i have in the OnConnect Event of the ClientSocket Call ClientConnected e.g.
procedure TForm1.ElvinClient1Connect(Sender: TObject; Socket: TCustomWinS...
I use the following code to capture when the minimise button of my program is pressed so that I can hide the form from the taskbar, and as such minimise to the system tray.
procedure TForm1.WMSysCommand;
begin
if (Msg.CmdType = SC_MINIMIZE) then
begin
form1.Hide;
show1.Checked :=false;
hide1.Checked :=true;
end;
...
In the following method, FreeMem(), throws an EAccessViolation. What are the possible reasons?
procedure TCustomDataset.FreeRecordBuffer(var Buffer: PChar);
begin
FreeMem(Buffer);
end;
EDIT:
As far as I understand TDataset Buffers are only allocated in:
function TCustomDataset.AllocRecordBuffer: PChar;
begin
Result := AllocMem(...