Search:
Type: Posts; User: _Wim_
Search:
Search took 0.03 seconds.
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
@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...
-
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...
-
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...
-
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...
-
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....
-
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",...
-
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...
-
...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
...
-
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...
-
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...
-
Hmmm, if I read that thread correctly, it says:
... and it seems that this dll uses cdecl..
So it can't be done??
_Wim_
-
The header file was already included in original message. Bottom-line the important stuff is:
#define EXPORT_API __declspec(dllexport)
int EXPORT_API...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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...
-
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
-
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 .. :)....
-
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'.. ...
-
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...
-
@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.
...
-
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...
-
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...
-
.. 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...
-
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...
-
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...
-
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...
-
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,...
-
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...
-
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...
-
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....
-
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...
|
Click Here to Expand Forum to Full Width
|