Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler restarts/errors while defining interface members #1124

Closed
fafalone opened this issue Aug 25, 2022 · 1 comment
Closed

Compiler restarts/errors while defining interface members #1124

fafalone opened this issue Aug 25, 2022 · 1 comment

Comments

@fafalone
Copy link
Collaborator

Describe the bug
The compiler restarts endlessly while trying to bring up Intellisense while defining interface members in modules.

To Reproduce

  1. New StdExe
  2. Add Module (.twin)
  3. Add reference to OLE Automation (stdole2.tlb)
  4. Save
  5. I'm not sure what exactly triggers it but I know the follow does:
[ InterfaceId ("4657278B-411B-11D2-839A-00C04FD918D0") ]
Interface IDropTargetHelper Extends stdole.IUnknown
    'Function DragEnter(ByVal hwndTarget as longptr, pDataObject as any, 
    
End Interface

[ InterfaceId ("0000010f-0000-0000-C000-000000000046") ]
Interface IAdviseSink Extends stdole.IUnknown
	Sub OnDataChange(pFormatEtc As FORMATETC, pStgMed As STGMEDIUM)
    Sub OnViewChange(dwAspect As DVASPECT, ByVal lindex As Long)

End Interface

Module ShellInterfaces

Public Type DVTARGETDEVICE
    tdSize As long
    tdDriverNameOffset As integer
    tdDeviceNameOffset As integer
    tdPortNameOffset As integer
    tdExtDevModeOffset As integer
    tdData(0) As Byte
End Type

Public Type FORMATETC
	cfFormat As Long
    pDVTARGETDEVICE As LongPtr
    dwAspect As DVASPECT
    lIndex As Long
    TYMED As TYMED
End Type
Public Type STGMEDIUM
	TYMED As TYMED
	data As LongPtr
	pUnkForRelease As LongPtr
End Type
Public Enum DVASPECT
    DVASPECT_CONTENT = 1
    DVASPECT_THUMBNAIL = 2
    DVASPECT_ICON = 4
    DVASPECT_DOCPRINT = 8
    DVASPECT_OPAQUE = 16
    DVASPECT_TRANSPARENT = 32
End Enum

Public Enum TYMED
    TYMED_HGLOBAL = 1
    TYMED_FILE = 2
    TYMED_ISTREAM = 4
    TYMED_ISTORAGE = 8
    TYMED_GDI = 16
    TYMED_MFPICT = 32
    TYMED_ENHMF = 64
    TYMED_NULL = 0
End Enum
Public Enum ADVF
    ADVF_NODATA = 1
    ADVF_PRIMEFIRST = 2
    ADVF_ONLYONCE = 4
    ADVF_DATAONSTOP = 64
    ADVFCACHE_NOHANDLER = 8
    ADVFCACHE_FORCEBUILTIN = 16
    ADVFCACHE_ONSAVE = 32
End Enum

End Module

The next member in IAdviseSink is Sub OnRename(pmk As LongPtr), the errors should start after you type the space after pmk.

Expected behavior
No restarts/errors.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • twinBASIC compiler version 0.15.99 (replicated on 97 and 98).

Additional context
Attaching the project I was working on; had just started it so it's just the code/actions taken listed in reproduce.
Demo.zip

@WaynePhillipsEA
Copy link
Collaborator

Fixed in BETA 100, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants