Search:

Type: Posts; User: _Wim_

Page 1 of 2 1 2

Search: Search took 0.03 seconds.

  1. create hyperlink using sheet number, rather than its name.

    Is it possible to insert a hyperlink to a specific sheet in my workbook, but specified by a formula or so?. All I can do now is specify a sheet by its (current) name. This works as long the sheet...
  2. Replies
    7
    Views
    964

    Re: Rename sheets in Excel using UDF

    Ahhh!! Many thanks. So basically, a UDF (=Function) cannot change the sheet names, but a macro (=Sub routine) can. Using the "Worksheet_change" sub and checking the range does it all for me! I've...
  3. Replies
    7
    Views
    964

    Re: Rename sheets in Excel using UDF

    Ok, summarizing:
    A user-defined function called by a formula in a worksheet cell cannot change the environment of Microsoft Excel.

    ...including renaming a sheet name. I'll have to think of...
  4. Replies
    7
    Views
    964

    [RESOLVED] Rename sheets in Excel using UDF

    Hi,
    Simple question (I guess). Googled and found a lot of info, but still can't figure this out.

    I have an Excel sheet with:
    190471

    And in VBA I have:
    190472

    The idea is that if I change...
  5. Re: How do I keep 2 zeroes after decimal point in a "currency" data type?

    Do you mean to *display* the variable cNum with 2 digits?

    Private Sub Command1_Click()
    Dim cNum As Currency
    cNum = 5
    Label1 = Format(cNum, "0.00")
    End Sub

    Edit: I just read more...
  6. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    Glad to see that the efforts of the experts here, and my humble efforts helped you (and me) to use these Chinese relays..!
    Note only the .bas and .frm are needed.
    Given time, I want to enhance the...
  7. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    @cliv Indeed the same Chinese relay card..!
    Issue with your code is that it doesn't work in VB6 IDE. So debugging is only possible by making an .exe, since that executes fine.
    One interesting...
  8. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    For the .dll refer to for instance http://www.giga.co.za/ocart/index.php?route=product/product&product_id=229, or google on "usb-relay-2"

    FWIW, so far I have this "wrapper" code, but it is...
  9. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    One other question:
    What is the difference between cdeclCallA and cdeclCallW calls? It seems that it treats string type parameters differently!? Better question would be: when do I use one and when...
  10. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    Thank you, thank you, thank you... The varptr(status) did it. I can now enumerate, open device, get status, close ... Next is actually open and close the relay, but I'm sure it will be similar/same...
  11. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    Thanks, indeed the function returned 0, because I first has opened the device. Apparently you can't enumerate if device is opened... Makes sense. Indeed the wrapper should check for a non-zero value....
  12. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    OK, what about this:

    Public Function EnumerateDevice() As USB_Relay_Device_Info
    Dim lPtr As Long, uRetVal As USB_Relay_Device_Info
    lPtr = cdeclCallA("usb_relay_device.dll",...
  13. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    Hmm this is getting a bit complicated for me to understand. First the 'cdeclCallA' function doesn't return anything, as far as I see. [EDIT: I read from some helpfiles that "DispCallFunc" returns the...
  14. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    ...ok, next 'challenge' ... One of the functions return a struct.
    So I have this code in a module (.bas):

    Public Enum USB_Relay_Device_Type
    USB_RELAY_DEVICE_ONE_CHANNEL = 1
    ...
  15. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    Fantastic! That seems to work. I copied all your "drop-in-code" into a cdecl.bas module (without even trying to understand what it does..), and used:

    Public Function...
  16. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    As far as I know, there is no 'DLLImport' function in VB6.. But correct me if I'm wrong.
    I have some source code for the dll (friom GitHub), that mentions:

    The thread pointed to me, showed...
  17. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    Hmmm, if I read that thread correctly, it says:

    ... and it seems that this dll uses cdecl..

    So it can't be done??
    _Wim_
  18. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    The header file was already included in original message. Bottom-line the important stuff is:

    #define EXPORT_API __declspec(dllexport)
    int EXPORT_API...
  19. Thread: C++ DLL to VB6

    by _Wim_
    Replies
    61
    Views
    18,228

    Re: C++ DLL to VB6

    This thread is almost 6 years old.. but I have the same issue/question. The original thread starter apparently never replied, so I don't know if e was successful with the answer.
    I want to drive...
  20. Replies
    11
    Views
    1,334

    Re: count value in strig

    What about the Split function?

    Private Sub Command1_Click()
    Dim MyString As String
    Dim Splitted() As String

    MyString = "AAA-DDD-BBBB-RRRR"
    Splitted = Split(MyString, "-")
    MsgBox...
  21. Re: locking mechanism for synchronize one instance of subroutine running. Mutex?

    I need multiple sources where the 'SingleRunOnly' can be called from. That includes several timers, but also manulal control through command buttons. The example with timers, including their interval...
  22. Re: locking mechanism for synchronize one instance of subroutine running. Mutex?

    Ok, I understand that Mutex doesn't apply for single thread application. Also agree that the locking mechanism should be in the actual routine itself, rather than in the timers. The DoEvents indeed...
  23. locking mechanism for synchronize one instance of subroutine running. Mutex?

    Hi, I have a subroutine that communicates with a device. The routine must finish first before another instance is allowed. Issue is that the routine can be called from multiple timers. I'm looking...
  24. Replies
    4
    Views
    2,195

    Re: Using dll API interface for FT260 under VB6

    Ahh.. this seems to work. At least I don't get errors, and I get DevNum being 2 as return value, if I insert the FT260. Without I get 1.


    I misread what wqwewto suggested, and thought he...
  25. Replies
    4
    Views
    2,195

    Re: Using dll API interface for FT260 under VB6

    OK, Thanks. So it's not just a simple thing to use this DLL with VB6. I guess I can try to contact FTDI to ask to this recompile thing you mentioned for VB6. Or
  26. Replies
    4
    Views
    2,195

    Using dll API interface for FT260 under VB6

    Hi, I want to use FTDI's FT260 - HID class USB to UART / I2C Master (https://www.ftdichip.com/Products/ICs/FT260.html). Needless to say, but I want to use VB6 to interface with this device .. :)....
  27. Replies
    19
    Views
    3,537

    Re: mapping data to structure

    I did.. That is, I use binarymode for MSComm. But I still use strings to store the data in, and use the B variants of the string functions, like ChrB$, LeftB$, MidB$, etc.. Kind of 'binary string'.. ...
  28. Replies
    19
    Views
    3,537

    Re: mapping data to structure

    Ahh thanks Elroy, this makes it clear. I guess I was 'lucky' with the first 3 structs, but the last gave me indeed strange results after using CopyMemory.
    So this padding happens internally in...
  29. Replies
    19
    Views
    3,537

    Re: mapping data to structure

    @Elroy:
    I believe I have problems with one structure, with this padding thing you mentioned.. These are the 4 structs I use, and LenB() of each gives me unexpected results on the last one.

    ...
  30. Re: Shelling to cmd window Wish to wait until process finished and then return

    There is a KnowledgeBase Archive article: https://jeffpar.github.io/kbarchive/kb/129/Q129796/ that deals with using Shell and wait for it... (Haven't read all replies, but seems to answer your...
  31. Re: using binary mode with MsComm, strings & byte arrays

    It seems tough that you can assign variables declared as Byte() to a variable declared as String and vice-versa. Even possible to concatenate array of bytes this way, without redim, nor for..next...
  32. Re: using binary mode with MsComm, strings & byte arrays

    .. so if I understand correctly, the InpBuf = InpBuf & .Input works because .Input returns a variant. By assigning it this way to a string (although not Unicode), I can use MidB$ and LeftB$, etc...
  33. using binary mode with MsComm, strings & byte arrays

    In another topic I've posted, I mentioned that I use the MsComm Serial port with InputMode=comInputModeText, while dealing with a Bluetooth dongle that communicates as a serial port and sends/receive...
  34. Replies
    19
    Views
    3,537

    Re: mapping data to structure

    Thanks all for your replies... as for the topic, mapping data to a struct, I'm done. I use the CopyMemery method with success, I'm not using strings in the struct. As for little/big endian, I yet...
  35. Replies
    19
    Views
    3,537

    Re: mapping data to structure

    That's precisely what I'm doing, and what I'm aware of using MsComm. The reason I'm using textmode as inputmode instead of binary, is because I find string handling easier than byte() arrays. Like...
  36. Replies
    19
    Views
    3,537

    Re: mapping data to structure

    Indeed that won't work... I was just quickly typing an example..
    But how about using CopyMemory? If I first convert my string to an array of bytes, then copy data from this array to the structure,...
  37. Replies
    19
    Views
    3,537

    mapping data to structure

    Hi, I'm working on a project to read data coming from a serial port. In the MSComm_OnComm event I collect all incoming data into InpBuf, global public declared as string. In another routine I extract...
  38. Replies
    9
    Views
    9,035

    Re: VB6 User Interface for Bluetooth device

    Just to wrap up this topic, so I can set it to solved...
    Meanwhile I found a API manual for this BLED112 dongle. It is actually very simple, once you know it .. :)
    I can open the dongle as a normal...
  39. Replies
    9
    Views
    9,035

    Re: VB6 User Interface for Bluetooth device

    This BLED112 dongle was choosen by our FW supplier, that writes the FW for a application involving the TI BLE processor. The idea is that through this dongle one can communicate to this TI board....
  40. Replies
    9
    Views
    9,035

    Re: VB6 User Interface for Bluetooth device

    Thanks for helping me out here. Again I realize this is not a real VB6 question, but as as you all out here (and there are many!!) are enthusiastic VB6 programmers I had hoped that one of you has...
Results 1 to 40 of 64
Page 1 of 2 1 2



Click Here to Expand Forum to Full Width