Solved

OLE procedure problem

Posted on 2000-05-12
1
182 Views
Last Modified: 2010-04-04
Hi all,
I have an automation object with 1 procedure which is get computername, but it wont compile because of the result:=Pccomputer.

heres the procedure
function GetComputerName : String;

 var
    pcComputer : PChar;
    dwCSize    : DWORD;
 begin
    dwCSize := MAX_COMPUTERNAME_LENGTH + 1;
    GetMem( pcComputer, dwCSize );
    try
       if Windows.GetComputerName( pcComputer, dwCSize ) then
          Result := pcComputer;
    finally
       FreeMem( pcComputer );
    end;
end;

it works in a normal delphi app but not in activex.
0
Comment
Question by:smurff
1 Comment
 
LVL 1

Accepted Solution

by:
msedi earned 25 total points
ID: 2803708
Hello,

try
  StrPas(pcComputer);

Good luck, MArtin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now