Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

OLE procedure problem

Posted on 2000-05-12
1
Medium Priority
?
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

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

try
  StrPas(pcComputer);

Good luck, MArtin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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 this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 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