473,399 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Declare Function RegisterWindowMessage

1
Getting an error in the following code...

Expand|Select|Wrap|Line Numbers
  1. Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Error message = "The code in this project must be updated for use on 64-bit system... PtrSafe attribute
Sep 5 '18 #1
1 1884
zmbd
5,501 Expert Mod 4TB
- You need to specify what environment you are working it.
- The error is fairly specific, you have not declared the code as safe to run in the 64Bit environment " PtrSafe "

Microsoft Article: "Compile error: The code in this project must be updated for use on 64-bit systems"

The crux of the solution given is to use the conditional compiler such as:
Expand|Select|Wrap|Line Numbers
  1. #If VBA7 Then
  2.     Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)
  3. #Else
  4.     Private Declare Sub Sleep Lib "kernel32" (ByVal ms as Long)
  5. #End If
and in each Declare statement you have to change the name of any parameter that is passed from "ms" to "millisecs."
Sep 5 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: TonyG | last post by:
I need to send a message to a window in another application. The name of the window is known at design time and set in the constant App2_MONITOR_CAPTION. The message is defined as X_GenerateEvent....
2
by: Lance Geeck | last post by:
I have many items that I lifted off from Microsoft's website several years ago. These samples were in VB6. I now want to convert an application to VB.NET. I am getting an error that says "As Any...
4
by: LamNgo | last post by:
Hi group, I have two application that need to communicate with each other, one written in C++ and the other in VB.NET. To communicate, I use "SendMessage" API to send message from C++ app to...
0
by: Benjamin Lukner | last post by:
Hi! I'd like to dynamically call API functions from different DLLs, depending on what platform the program runs. Now I'm wondering what the most simple way may be (without meta code and compiler...
3
by: Altman | last post by:
I am having problems with Declaring a function from a dll. I had it work in VB 6 but I can't get it to work in VB.net. This was the call in VB6 Public Declare Function MBTConnect Lib "MBT" (ByVal...
2
by: pangel83 | last post by:
I've been trying for days to write a piece of VB.NET code that will read from winamp's memory space the paths of the files from the current winamp playlist. The GETPLAYLISTFILE command of the...
2
by: Tany | last post by:
How can I declare function returning array of Integer pointers . Please help !!
5
by: benben | last post by:
How do you declare a function f that takes a parameter that is a pointer to itself? So you can do f(f); Pardon my curiosity! Ben
4
by: marss | last post by:
How to declare function that accepts any generic list as input parameter? I mean I need void foo(List<list) { } where: Valid parameters are List<SomeInfo>, List<string>, List<Guid>, e.t.c....
2
by: zzzxtreme | last post by:
hi i built a very simple dll with delphi library Printing; uses SysUtils, Classes, Dialogs; {$R *.res} function Hello: WideString; stdcall; begin ShowMessage('test'); result := 'blah';
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.