Solved

OLE procedure problem

Posted on 2000-05-12
1
183 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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