Search found 484 matches

by aloberoger
Aug 13, 2020 18:48
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

with these two functions things are normal. curious that you still have bugs Constructor CPicture(ByVal opic As IPicture Ptr) If m_pPicture Then m_pPicture->lpvtbl->Release(m_pPicture) EndIf m_pPicture=opic If m_pPicture Then m_pPicture->lpvtbl->AddRef(m_pPicture) EndIf End Constructor Operator CPic...
by aloberoger
Aug 13, 2020 18:43
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

José said ...
if you have an example on hand, this will be welcome please
by aloberoger
Aug 12, 2020 18:13
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

I said with this in constructor and operator

Code: Select all

If m_pPicture then m_pPicture-> lpvtbl-> AddRef (m_pPicture)

we can use delete see my last post

but it seems to me that because of the reference even if Delete is not used the memory is erased?
what do you thing?
by aloberoger
Aug 11, 2020 15:07
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

I believe the Constructor (As ipicture Ptr) as well as Operator Let were missing: If m_pPicture then m_pPicture-> lpvtbl-> AddRef (m_pPicture) but it seems to me that because of the reference even if Delete is not used the memory is erased? now: dim pic1 as Cpicture Dim ByRef pic2 as Cpicture =*Cast...
by aloberoger
Aug 11, 2020 14:30
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

I believe that the first example creates a copy with a new object, you should know that it is the same image. but it is normal that as long as a copy exists the storage memory area is not deleted. but the first pic1 object is deleted except the area of ​​m_picture. What are the other languages ​​doi...
by aloberoger
Aug 11, 2020 14:23
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

yes we can vizualize things with :

pic1.destructor
pic2.destructor

Sleep


in the end how to do with freebasic
gdiplus offers for example a clone function
by aloberoger
Aug 11, 2020 12:29
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

have you tested with a specific case? for me it's ok With : Destructor CPicture() Print "Destructor " & @This UnLoad() End Destructor Dim pic1 as Cpicture pic1.loadfromfile("C:\Users\Administrateur\Desktop\126_glyphspro\24x24\accounts.bmp") 'Dim pic2 as Cpicture = pic1 Dim pi...
by aloberoger
Aug 11, 2020 7:06
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

the code has already been modified

you need a .bmp file and adjust the path
by aloberoger
Aug 10, 2020 22:28
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Re: Byref in return function

here is the whole class: #Include Once "windows.bi" #Include Once "win/ocidl.bi" #Include Once "win/olectl.bi" Type CPicture extends object public: Declare Constructor() Declare Constructor(ByVal opic As IPicture Ptr) Declare Constructor (ByRef opic As Const CPicture) D...
by aloberoger
Aug 10, 2020 9:14
Forum: Tips and Tricks
Topic: Byref in return function
Replies: 18
Views: 761

Byref in return function

In this case how to manange byref function: Function CPicture.Clone()ByRef As CPicture Dim As CPicture Ptr pClone = new CPicture(This) return ByVal pClone End Function Function CPicture.FromIPicture(ByVal opic As IPicture Ptr) ByRef As CPicture Return ByVal (New CPicture(opic)) End Function dim byre...
by aloberoger
Aug 10, 2020 9:00
Forum: Projects
Topic: MyFbFramework - My FreeBasic Framework
Replies: 11
Views: 1338

Re: MyFbFramework - My FreeBasic Framework

Xusinboy Bekchanov wrote:Thank you.
Now the events of the form and other controls will be different.
I'll see.


Yes for form or usercontrol( if you implement this) but not for other controls I think

I repeat it even for the forms, the old style events will always be supported.
by aloberoger
Aug 08, 2020 19:50
Forum: Projects
Topic: MyFbFramework - My FreeBasic Framework
Replies: 11
Views: 1338

Re: MyFbFramework - My FreeBasic Framework

I'm not asking to change processmessage. the advantage is this: #Include Once "../guis.1.0.bi" Type CFlexGridCombo extends CFORM public: Declare Constructor Declare Destructor As CComboBox m_cCombo As CFlexGrid m_FlexGrid Declare Static Sub Combo1_SelChange(BYREF Sender As object) Declare...
by aloberoger
Aug 07, 2020 16:24
Forum: Projects
Topic: MyFbFramework - My FreeBasic Framework
Replies: 11
Views: 1338

Re: MyFbFramework - My FreeBasic Framework

a suggestion you have to make some virtual functions in Form class, here is an example : type Form ... Declare virtual Sub Form_MouseUp (ByRef sender As OBJECT,MouseButton As Integer,Shift As Integer,x As Integer,y As Integer) end type Sub Form.Form_MouseUp(ByRef sender As OBJECT,MouseButton As Int...
by aloberoger
Mar 09, 2020 21:05
Forum: Tips and Tricks
Topic: UDT: Dynamic Type
Replies: 26
Views: 1593

Re: UDT: Dynamic Type

To be exhaustive, it would be also necessary to define all the non-member operators useful for each dynamic type. why don't you implement a copy constructor? Declare Constructor (Byval rhs As byvarDT) - For my by-var-variant: Type byvarDT '' Dynamic Type (by variable) Public: Declare Constructor ()...
by aloberoger
Dec 27, 2019 20:31
Forum: Projects
Topic: VisualFBEditor - IDE for FreeBasic
Replies: 116
Views: 19056

Re: VisualFBEditor - IDE for FreeBasic

Here is a reel designer for FB.

some observations:
-how to assign once the path of the compiler?
-sometimes the assignment of the main project file does not work. how to procees

Go to advanced search