News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Bluetooth - LIB & INC

Started by georgek01, February 08, 2006, 09:47:25 AM

Previous topic - Next topic

georgek01

Hello all!

MSDN says to use Bluetooth the irprops.cpl is required - I have this on my XP machine and have used the DLL2LIB and DLL2INC apps to create the required DLL and LIB files for MASM.

The only line the INC file contains however is the following: CPlApplet PROTO C :VARARG

Once I've included the files in my project I'm still unable to compile due to: error A2006: undefined symbol : ...

Should I be using sockets instead?
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

QvasiModo

The irprops.cpl file is just the control panel applet...

P1

georgek01,

Post a test app with files which demonstrates the problem you are having.

Regards,  P1  :8)

georgek01

As soon as my test app is complete I'll post it here. I've actually only started with the first few lines of code and found invoke Bluetooth... calls were undefined symbols.

QuoteThe irprops.cpl file is just the control panel applet...

Yes it is. But isn't a CPL a DLL too? If not, which DLL does it use?

Just another point - NS_BTH (namespace identifier) is a required parameter for a few of the socket calls. I'm unable to find it in the winsock.h or any other header file. Any idea perhaps where I can find the value that equates to NS_BTH?

Thanks for the assistance!
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

P1

It all goes back to "BluetoothAPIs.h" & "bthdef.h" & "Bthsdpdef.h" in Microsoft Platform SDK, which is downloadable, with libs.

Some other M$ info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devguidesp/html/sp_conbluetooth.asp

Google is my friend, is he yours ???  :green2

Regards,  P1  :8)

georgek01

P1, Thank you for the info - I've started the SDK download, and it's gonna take a while...  ::)
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

georgek01

#6
LIBs I get from the PSDK, can I use them as is, or do they need to be converted to a format MASM recognises?

When the app starts up, I get the following error:

The procedure entry point BluetoothFindFirstDevice could not be located in the dynamic link library irprops.cpl.
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

Vortex

You can use the libraries from PSDK with Masm. VC++ and Masm are using the same Common object file format ( MS COFF format )

georgek01

#8
This is what I have so far. All I'm trying at this stage is to get a successful response from BluetoothFindFirstDevice.

When the app starts up however, I get the following error:

The procedure entry point BluetoothFindFirstDevice could not be located in the dynamic link library irprops.cpl.

[attachment deleted by admin]
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

P1

georgek01,

Hang in there George, we will get you through this.

Run L2Inc against your irprops.lib.
Add irprops.inc to your Project.
Fix all the resultant errors.   ( Like remove protos of BT api functions.  And any other duplicated definations you may have. )

Fix this:  Did you mean lParam ???
mov eax, groupID
mov lvi.iGroupId, eax


Work these items. 

MSDN is a wonderful tool to help you.

Regards,  P1  :8)

georgek01

#10
Firstly, thank you for your assistance!


I still however receive the same error.

QuoteFix this:  Did you mean lParam ???
groupID is passed to the procedure that adds items to the listview. Should I rather be using lParam?

What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

P1

Quote from: georgek01 on February 20, 2006, 05:54:54 AM
QuoteFix this:  Did you mean lParam ???
groupID is passed to the procedure that adds items to the listview. Should I rather be using lParam?
Assembling: C:\Masm32\BT\ListView.asm
C:\Masm32\BT\ListView-lib.asm(67) : error A2006: undefined symbol : iGroupId

LV_ITEM STRUCT
  imask         DWORD      ?
  iItem         DWORD      ?
  iSubItem      DWORD      ?
  state         DWORD      ?
  stateMask     DWORD      ?
  pszText       DWORD      ?
  cchTextMax    DWORD      ?
  iImage        DWORD      ?
  lParam        DWORD      ?
  iIndent       DWORD        ?
LV_ITEM ENDS

LVITEM  equ  <LV_ITEM>

LVGROUP STRUCT
    cbSize       dd ?
    imask       dd ?
    pszHeader    dd ?
    cchHeader    dd ?
    pszFooter    dd ?
    cchFooter    dd ?
    iGroupId    dd ?
    stateMask    dd ?
    state       dd ?
    uAlign       dd ?
LVGROUP ENDS


I found the error, you declared the wrong local variable structure type.

Please review and fix this the way you want it.  Re-build projects files and replace the old zip file.

Regards,  P1  :8)

evlncrn8

hmm, doesn't appear to work...

Error Control Code : 1000
The specified module could not be found

(happens when i click on 'find devices')

yet, i do have bluetooth, and at least 3 bluetooth devices sitting beside me
and %windir%\system32\fsquirt.exe works on the system, so it has to be a code
bug somewhere...

P1

Quote from: evlncrn8 on July 25, 2006, 06:56:52 AMhmm, doesn't appear to work...
He never replied and said that it did.  I understood it was a work in progress.

I don't have a bluetooth device for functional testing, but I was just getting him past the programming issues. 

Regards,  P1  :8)

evlncrn8

debugging some of it and i think some structs are screwed, got it working on my pc eventually, but the irprops really looks limited, better method is via winsock by the looks of it, i can scan but can't connect currently.. i'll post the code once i have it done