WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

Coding with struct and procedures, I call many in my code a one function with a different struct, can i make a procedure for it?

ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 874
Member No.: 5019
Joined: 13-May 07


Hi

I coding a new Toy now have i a question

I call many in my code a one function with a different struct, can i make a procedure for it?

example:

invoke GetDlgItem,hWnd,1001
invoke SendMessage,eax,CB_GETCURSEL,0,0
mov eax,[Sample+eax*4]
mov [ESI].CONFIG.format.LHV1.dwSample1,eax

invoke GetDlgItem,hWnd,1002
invoke SendMessage,eax,CB_GETCURSEL,0,0
mov eax,[Sample2+eax*4]
mov [ESI].CONFIG.format.LHV1.dwSample2,eax

my goal is write for it a routine:

fillStruct proc hWnd:Dword,ResId:DWORD,Struct1:DWORD,Struct2:DWORD

invoke GetDlgItem,hWnd,ResId
invoke SendMessage,eax,CB_GETCURSEL,0,0
mov eax,[Struct1+eax*4]
mov [ESI].CONFIG.format.LHV1.Struct2,eax
ret
fillStruct endp

have any an idea?

greets
ragdog
PMUsers Website
Top
okuda
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 8601
Joined: 5-June 08


How are you defining "Struct1","Struct2" and "CONFIG?"?
PMEmail Poster
Top
ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 874
Member No.: 5019
Joined: 13-May 07


Hi

Yes this have i all define this works all fine
PMUsers Website
Top
ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 874
Member No.: 5019
Joined: 13-May 07


My problem is only this routine wink.gif
PMUsers Website
Top
JimG
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 725
Member No.: 11
Joined: 16-May 04


What okuda asked is may we see the definition of of the structures and variables? There are several answers depending upon how they are defined and how the proc is called.

Better yet, upload a small test case for us to look at.

It's not an impossible problem, but you have to pass the correct values for it to work.
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google