Author Topic: New Dll Error  (Read 8750 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
Re: New Dll Error
« Reply #15 on: March 26, 2013, 08:05:24 AM »
Aha...Ok Charles  ;)
I will check this now ...

Aurel

  • Guest
Re: New Dll Error
« Reply #16 on: April 16, 2013, 08:01:54 AM »
Charles...
latest oxygen dll not work properly .
look i have this in include file:
Code: [Select]
'MsgBox--------------------------------
Function MsgBox (lpText AS STRING,lpCaption AS STRING) as INT
RETURN MessageBox 0,lpText,lpCaption,0
End Function
It is simple MsgBox function, i also have try with byref and with byval
and not work ...
i have receive strange error that wndproc not found  ???
It is strange that work inside subroutine in program ???

prog:
'test
include "awinh.inc"
MsgBox "Message...","Title"


And more strange thing sometimes not compile then gxo2 just stay hangin in memory  :o
what kind of errors is all about ???

and also again Tally( temp, delim) not work...
This time i dont have any lookahead in awinh.inc

I really don't know what to do.. :-\
with every new oxygen.dll more and more problems , so i again must use older dll (409kB).

Charles  please,do you can concentrate on bug fixed release ...then adding new asm or what ever else
function ,so please make bug fixed version that most of us can use our older programs with few
modifications..etc and not with constant errors,crushes...etc..
thanks ..Aurel  ;)
« Last Edit: April 16, 2013, 08:23:27 AM by Aurel »

Charles Pegge

  • Guest
Re: New Dll Error
« Reply #17 on: April 16, 2013, 09:28:37 AM »
Hi Aurel, I test new DLLs on your projectsB/Scintilla/AsciEdit, among many other progs, but yes this is very odd. If you add any statement after masbox, like a=4, then it works fine

My test code:

'u=loadlibrary "user32.dll"
'bind u
'{
' MessageBox MessageBoxA
'}

Library "user32.dll"
! MessageBox alias "MessageBoxA"
Library ""


Function MsgBox (lpText AS STRING,lpCaption AS STRING) as INT
If lpCaption = "" then lpCaption="<MsgBox>"
Return MessageBox 0,lpText,lpCaption,0
End Function

MsgBox "hello","title"

a=4
'print "ok"
'MessageBox 0,"AA","BB",0


PS: it appears to be caused by the last param on the last line of a prog  being a quoted string. If you add enclosing brackets or use a variable, its okay. This looks an old bug and you discovered the evil combination. So Thank you for exposing it :)
« Last Edit: April 16, 2013, 09:55:50 AM by Charles Pegge »

Aurel

  • Guest
Re: New Dll Error
« Reply #18 on: April 16, 2013, 10:45:33 AM »
Thanks Charles.. ;)
Maybe sometimes my posting here looks like trolling or something like that.
But i am very impressed with your work... :)
I always watch very close what was heapend in any of my program.
Of course anyone can make mistake or miss something.
keep up and i hope that all things will work properly... ;)

Charles Pegge

  • Guest
Re: New Dll Error
« Reply #19 on: April 16, 2013, 01:06:15 PM »
Library is a directive rather than a control block. Personally, I prefer extern .. end extern.

extern may include lib, calling-convention, export and/or virtual

extern lib "kernel32.dll" stdcall
!..
end extern

extern stdcall export

myfun(...)
...
end function

end extern
« Last Edit: April 17, 2013, 03:46:08 AM by Charles Pegge »

Aurel

  • Guest
Re: New Dll Error
« Reply #20 on: April 17, 2013, 01:37:25 AM »
I agree with Peter that Declare Function or !
! MessageBoxA Lib "user32.dll" (sys hwnd, string lpText, lpCaption, sys wType) As Long
is far easier and better .
Charles when we can espect bug fixing with this weird string litteral problem?

Aurel

  • Guest
Re: New Dll Error
« Reply #21 on: April 17, 2013, 07:10:12 AM »
Charles
I don't know why again Tally(temp,",") is not work.
so i try :
Tally(temp,chr(44))
and agin not work ,how is this posible ,is this some really weird bug or something starange that
compiler can see chr()... ???

Charles Pegge

  • Guest
Re: New Dll Error
« Reply #22 on: April 17, 2013, 09:50:08 AM »
I dont have an original but here is a byte-based tally. It skips quoted words, but is also able to count individual quote marks.



function tally(string s,k) as sys
'
if s="" or k="" then exit function
byte   sb at (strptr s)
byte   kb at (strptr k)
sys    lk=len k
sys    ls=len(s)-lk+1
sys    i=1
sys    j
indexbase 1
'
do
  if sb=34 or sb=39 or sb=96 ' " `
    if sb<>kb
      byte cq=sb
      do 'SKIP QUOTE
        @sb++
        i++
        if i>ls
          jmp fwd done 'LIMIT
        elseif sb=cq
          exit do
        end if
      end do
    end if
  end if  
  if sb=kb
    j=2
    do
      if j>lk
        exit do
      end if
      if sb(j)<>kb(j)
        j=0 : exit do 'NO MATCH
      end if
      j++
    end do
    if j>lk
      function++ 'TALLY
      i+=lk
      @sb+=lk
      continue do
    end if
  elseif i>ls
    exit do 'LIMIT
  end if
  @sb++
  i++ 'NEXT BYTE
end do
done:
end function


print tally("one,two,three,,`,q,`","`")        '2
print tally("one,two,three,,`,q,`","`,q,`")    '1
print tally("one,two,three,one,`,q,`","one")   '2
print tally("one,two,three,one,`,q,`",chr(44)) '4



Aurel

  • Guest
Re: New Dll Error
« Reply #23 on: April 17, 2013, 10:06:42 AM »
Hi Charles..
here is Tally which i use because i need to store commas positions in array:
Code: [Select]
FUNCTION Tally(STRING Main$,STRING Match$) As INT
'print "TALLY:" + main$
    DIM i,j,q,mlen,matchlen As INT
DIM t$ As STRING
    mlen = LEN(Main$)
    matchlen = LEN(Match$)
    i = 1
    j = 0
    q = 0
    IF (mlen = 0) OR (matchlen = 0)
        RETURN j
    END IF
   
    do

t$ = MID(Main$,i,matchlen)
IF t$ = Chr(34) THEN q = q + 1
IF q=2 THEN q = 0
        IF t$ = Match$ AND q=0
           j++
'mem del$ position
dpos[j]=i
  'j = j + 1
         
        END IF

           i++
        IF i > mlen then
           exit do
        END IF
    end do
'tbreak:
    RETURN j
END FUNCTION

So o2 complain like this:
That strings inside not defined... ???

Aurel

  • Guest
Re: New Dll Error
« Reply #24 on: April 17, 2013, 10:11:29 AM »
here is shot of this wird error ,o2 see function with main as string even is not defined in tally function ???

X

Charles Pegge

  • Guest
Re: New Dll Error
« Reply #25 on: April 17, 2013, 10:45:02 AM »
We seem to have acquired  sensitivity to "$" suffixes attached to parameter names, when using C style prototypes. If you remove the '$' from both parameter names, it should work. I only support it as a legacy, but this should be quite easy to fix.

Aurel

  • Guest
Re: New Dll Error
« Reply #26 on: April 17, 2013, 01:21:06 PM »
So Charles
i must remove from every string name $ ...this is really weird.
I don't see that any other compiler complain about using $ or any other character on the end of varible
name...
So do i must remove all $ from string variable names or not  ???

Aurel

  • Guest
Re: New Dll Error
« Reply #27 on: April 17, 2013, 01:29:02 PM »
Aha ...
I forget to look into Oxygen update topic... ::)
Thanks Charles finally work OK ,like in old oxygen version ;)
just one small point maybe someone else find this unusual...
when we have:

FUNCTION Tally(byval Main$ as string,byval Match$ as string) As int
this cose error in reading function BUT
when we use this:
FUNCTION Tally(Main$ as string,Match$ as string) As int
then work fine...
 ;)