SEARCH YOUR SOLUTION HERE |
|
|
Accessing a dll variable from a program |
|
"creek" wrote in message
news:477ba656$1@newsgroups.borland.com...
> I'm not really familiar with DLLs, but I urgently need to know how can I
> access a DLL variable from the main program (I have just the main program
> and a ...
|
|
Posted On: Thursday 22nd of November 2012 11:15:29 PM |
Total Views:
381 |
View Complete with Replies
|
Using dll files
 (407 Views)
Its been a while since I've use dlls for any projects, but recently after
acquiring a Velleman USB board I decided I'd like to make use of it.
The problem is, previously I experimented using eraserext.dll (from eraser)
within a plugin for another program and it didn't seem to get along very
well.
Can dll's be used from other dll's or plugins generally - I've assumed no
from past experience but I'd really like to create a plugin for an existing
program using Max components TPlugin which will make use of the USB
hardware. Unfortunately the only way to communicate with the hardware is
through a dll file!
Is this possible or am I going to end up chasing my tail round in circles
|
Parameters & dll
 (371 Views)
My D7 app calls a dll to read memories from a radio. The dll produces a string, and
the length of the string. Calling one function in the dll works fine, but other
functions, using the same parms don't. It's the length that loses it.
procedure TfrmClone.SpeedButtonReadClick(Sender: TObject);
var
i, p: integer;
GetFreq: TGetFreq; //function(s: PChar; var slen: DWORD): LongBool; stdcall;
begin
dllFunc := 'GetFreq';
if ProcHandle 0 then
begin
GetFreq := GetProcAddress(ProcHandle, dllFunc);
if @getFreq nil then
begin
for i := 1 to LoopCtr do
begin
l := 0;
setlength(s,11); // s now contains some random garbage
if GetFreq(pChar(s),l, i) then // s is a global string, l is a global dword
RetFreq := s;
RetMode := GoForMode; // go get mode
..
..
..
end;
function TfrmClone.GoForMode: Shortstring;
var
GetMode: TGetMode; //function(s: PChar; var slen: DWORD): LongBool; stdcall;
begin
result := '';
dllFunc := 'GetMode';
if ProcHandle 0 then
begin
getMode := GetProcAddress(ProcHandle, dllFunc );
if @getMode nil then
begin
l := 0;
if GetMode(pChar(s),l) then
result := s;
end;
end;
end;
=========== In the dll ==============
function GetFreq(s: PChar; var slen: DWORD; chSet: integer): LongBool; stdcall;
//slen is 0
var
fr: string;
begin
result := false;
if chSet > 0 then
dll.SetChannel(chSet);
fr := dll.pollradio;
slen := length(fr); //slen is 7
if length(fr) > 0 then
begin
result := true;
strPLCopy(s, fr, slen);
end;
end;
function GetMode(s: PChar; var slen: DWORD):LongBool; // slen is Inaccessible here
var
mode: string;
begin
result := false;
mode := dll.PollRadio;
slen := length(mode); //AV
if slen > 0 then
begin
result := true;
strPLCopy(s, mode, slen);
end;
end;
|
Calling C-dll from delphi
 (364 Views)
group,
trying to translate a .h file for use within delphi.
How do I translate
typedef void (*GEOSMessageHandler)(const char *fmt, ...);
void initGEOS(GEOSMessageHandler notice_function,GEOSMessageHandler
error_function);
into something useful for Delphi
|
bzip2.dll for download (or can someone compile it?)
 (447 Views)
Hi all,
I'm out hunting for bzip2.dll for use with Delphi classes (DI or Jcl
Decompressors), but can't find a recent version ready compiled for Win32
Although google gives many hits on "bzip2.dll" but I don't trust
clicking any of those cheap .dll mouse traps which is now littering the
entire Internet.
Latest source (1.0.5 as of mars 2008) is available from here, http://www.bzip.org/downloads.html
Perhaps can anyone compile it for me (or give a hint about a secure
link for download).
Anyone
|
Can't Start RAD Studio 2007, AV in ieframe.dll
 (381 Views)
Hi ,
I can't start RAD Studio 2007 this morning. After the splash screen has
been shown and all packages has been loaded, the splash disapears and I
get this error thanksfully trapped by MadExcept :
I can send the full bug report to binaries, I required.
Any ideas
main thread ($c70):
1b8efe5e +000 ieframe.dll
7c91eae0 +010 ntdll.dll
KiUserCallbackDispatcher
7e39fc53 +02e USER32.dll CreateWindowExW
201caf2b +043 vcl100.bpl OleCtrls 863 +5
OleCtrls.TOleControl.CreateWnd
2013f80a +016 vcl100.bpl Controls 6883 +3
Controls.TWinControl.CreateHandle
2013fad0 +074 vcl100.bpl Controls 6994 +7
Controls.TWinControl.UpdateShowing
2013fafe +0a2 vcl100.bpl Controls 6997 +10
Controls.TWinControl.UpdateShowing
2013fcb1 +0e5 vcl100.bpl Controls 7041 +21
Controls.TWinControl.UpdateControlState
20142692 +026 vcl100.bpl Controls 8397 +3
Controls.TWinControl.CMVisibleChanged
2013c527 +2bb vcl100.bpl Controls 5146 +83
Controls.TControl.WndProc
201406a7 +4fb vcl100.bpl Controls 7304 +111
Controls.TWinControl.WndProc
20159e7f +553 vcl100.bpl Forms 3512 +136
Forms.TCustomForm.WndProc
2013c1b4 +024 vcl100.bpl Controls 5021 +5
Controls.TControl.Perform
2013ac16 +026 vcl100.bpl Controls 4169 +5
Controls.TControl.SetVisible
201597b6 +03a vcl100.bpl Forms 3316 +8
Forms.TCustomForm.SetVisible
20d1bad4 +324 designide100.bpl DeskForm 492 +74
DeskForm.TDesktopForm.LoadWindowState
0041dc2c +000 bds.exe AppMain 5602 +0
AppMain.TAppBuilder.LoadWindowState
0041262d +005 bds.exe AppMain 1271 +0
AppMain.TBorlandIDE.LoadWindowState
209dd06e +1fa coreide100.bpl Desktop 642 +59
Desktop.LoadDeskState
209dfa7e +036 coreide100.bpl Desktop 1664 +5
Desktop.TDesktopState.Load
209df463 +03b coreide100.bpl Desktop 1496 +4
Desktop.TDesktopStates.LoadDesktop
20a5d95c +138 coreide100.bpl DocModul 786 +35
DocModul.TFilterList.OpenFile
20a615b7 +04f coreide100.bpl DocModul 2514 +3
DocModul.CallDefaultOpenProc
209de6ad +421 coreide100.bpl Desktop 1088 +81 Desktop.LoadDesktop
0041399c +170 bds.exe AppMain 1885 +51
AppMain.TAppBuilder.CMPostCreateInit
2013c527 +2bb vcl100.bpl Controls 5146 +83
Controls.TControl.WndProc
201406a7 +4fb vcl100.bpl Controls 7304 +111
Controls.TWinControl.WndProc
20159e7f +553 vcl100.bpl Forms 3512 +136
Forms.TCustomForm.WndProc
2013fdd0 +02c vcl100.bpl Controls 7073 +3
Controls.TWinControl.MainWndProc
20040e4c +014 rtl100.bpl Classes 11583 +8 Classes.StdWndProc
7e3996c2 +00a USER32.dll DispatchMessageA
201625f0 +0fc vcl100.bpl Forms 8105 +23
Forms.TApplication.ProcessMessage
2016262a +00a vcl100.bpl Forms 8124 +1
Forms.TApplication.HandleMessage
2016291f +0b3 vcl100.bpl Forms 8223 +20
Forms.TApplication.Run
--
Pierre Y.
|
D2006 crash when trying to debug COM dll
 (441 Views)
when trying to debug a specific COM dll the IDE crash, or i get only the
CPU Debug video or it just get stuck.. other COM Dll's debugging works fine,
fellow workers doesn't have problems with debugging that DLL as well but on
my computer it keeps crashing...
any ideas
tnx, roi.
|
dcc70.dll troubles
 (377 Views)
Suddenly today my D7(with all available updates) started AVing every few seconds in
dcc70.dll when editing. When it happens, the unit being edited becomes read only(but
not on disk). Also I get an AV on closing Delphi. Restarting Delphi has no effect.
I did a repair install, which ran so quickly, I don't believe it did anything.
2 things changed on the box yesterday, I don't know how to determine if either is a
cause.
I installed SP3 for Windows XP, and tried unsuccessfully to install Mike Lischke's
TThemeManager component(paraphrasing here - unit already compiled, then themes unit
compiled with a different version).
I have a couple of MadExcept logs I can put on attachments, if they're of any use.
There seems to be a lot on the web about this dll, but I didn't find a real fix. I
hope there is one, because this install is unusable.
|
accessing local drive when working with terminal server
 (147 Views)
, a customer of mine changed the way they work with the network. Now
they use terminal server and all the client pc run my system directly from
the server local drive C:
I used to have a folder "C:\LocalOptions" in order to save some local
configuration files for each PC. Now all the PCs have the same LocalOption
folder, as they are running my app locally via terminal server. Is there any
way to see the local drive of the client PC when I'm within Terminal Server
I use Delphi 6.
|
Using a c dll with Delphi
 (431 Views)
Hi!
From my Delphi program, I would like to use my dll compiled with c, but I
get a runtime error when the function is called.
The parameter is char* c type, that I translate in PChar in Delphi. (I only
have the problem using char*, if I do a similar function using int type in
C, and integer type in Delphi that works)
My dummy function "TextFunction()" should simply return the string passed
into parameter.
///////////////////////// c code : ////////////////////////
char* DLL_EXPORT TextFunction(char* text)
{
return (text);
}
////////////////////////////////////////////////////////////////////////////
///
////////////////////////////// Delphi Code : ///////////////////////////////
Text: TextFunction( text: PChar) : PChar; stdcall;
function LoadDLL: boolean;
function LoadDLL: boolean;
begin
Result := false;
DLLtest := LoadLibrary('testdll.DLL');
if DLLtest 0 then
begin
Result := true; //DLL found
//Get the procedure addresses
@TextFunction:= GetProcAddress(DLLtest, 'TextFunction');
end;
end;
Does anyone see what I am doing wrong
|
THreads, dlls, and UDP
 (357 Views)
Hej,
I have a service appication that starts three threads. These threads all
call a DLL to send a message using UDP. The dll uses the UDPClient
component (I think its called that). Somewhere in all this I find that the
call to send the message via UDP causes an exception.
This dll has been used many times over a long period of time, but never from
a thread, and never more than once per machine.
So I wonder if my dll needs to be "thread safe" and what does this mean Or
could it be that the calls to the UDPClient are occuring symultaneously and
therefore causing the problem
Any advice would be welcome.
/Richard
|
Fail to load dll in Vista
 (389 Views)
I write a dll and an exe to call it with LoadLibrary. It runs normally
in any OS except Vista. In Vista, when it just runs LoadLibrary function,
the exe is hanged. Do you have any idea on it
|
Calling C-dll from delphi
 (440 Views)
group,
trying to translate a .h file for use within delphi.
How do I translate
typedef void (*GEOSMessageHandler)(const char *fmt, ...);
void initGEOS(GEOSMessageHandler notice_function,GEOSMessageHandler
error_function);
into something useful for Delphi
|
Borland.Studio.Together.dll error on D2007 startup
 (447 Views)
Error when starting Delphi for Win32 2007:
Failed to load IDE add in 'C:\Program Files\CodeGear\RAD
Studio\5.0\bin\Borland.Studio.Together.dll'.
Exception has been thrown by the target of an invocation.
Additional Information: The type initializer for
'com.borland.tg.sci.SciModelAccess' threw an exception.
Any ideas
--Bruce...
|
interoperable dll
 (372 Views)
I need to make dll to wrap up some functions the signatures below:
function envolve(const txt: widestring): widestring;
function devolve(const txt: widestring): widestring;
The dll functions to be called from VB6, Delphi Win32, VS .NET (c#, VB ). The output ...
|
[HELP] Debug Error bordbk105n.dll
 (645 Views)
Hi
I have update today, IW 9 from .16 to .30 , in delphi 2007 RAD UPD3 ARCH.
now....
when i press in IW project F9 , Delphi show an [Running] :
Access Violation... Error bordbk105n.dll
and i must Terminate ...
|
Examone variables when at a form
 (131 Views)
Is there a way to examine variables when a program is sitting at a
form I can't figure out how to do it - clicking the stop button and
then trying to do it from the source code doesn't work ...
|
Loading a dll form
 (417 Views)
I have a dll that loads into a child window, via a package. The problem is,
it opens in a new window, not within the child window. This also happens if
I just just open the dll from from within ...
|
Environmental variable settings not respected
 (112 Views)
I got a weird bug in RAD Studio Delphi win 32 (december update).
The compiler does not respect the path aliases I set in environmental
variables.
For example if I add a new user environmental variable ROOT and set it ...
|
|
|