473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

public function name() as Boolean ... boolean help needed

Hello,

I am working on a windows dll and this is my problem:
Expand|Select|Wrap|Line Numbers
  1. 'api
  2. Public Declare Function myFunction Lib "Functionmine.dll" (byval ProgieName as String) as Boolean
Expand|Select|Wrap|Line Numbers
  1. 'entry point in module
  2. Public Function myFunction(byval ProgieName as string) as Boolean
  3. 'some code here and then:
  4. Load Form1 'a form inside the dll, load form - form1.show same thing in this case
  5. End Function
My problem is that i want the boolean value from the function to be filled by the events of the form, and not the events of this function. I have tried adding myFunction = true, and = false etc etc and i have left it blank as i have here.
I have even tried to declare a global boolean and fill the function that way but its just not working.
Should i run it through a timer or something like that? or is it jus not possible, although i'm 100% sure it is possible.

any help would be so good

btw when form1 loads it sends a winsock connection, the connect sends the data, and the data goes to the data arrival. This is where i want to set the boolean value for the myFunction api call.
Apr 26 '07 #1
1 3288
Killer42
8,435 Expert 8TB
Let's deal with one thing at a time. Are you saying that even if your function just says MyFunction = True the true result is not returned? If so, let's forget about the form until we work out why your function isn't communicating properly with the caller. Nothing you do with your form will achieve much if your caller can't get your return value anyway.

If the function OK and the problem is in getting the value back to it from the form, try using Form1.Show vbModal. This will show the form "modally", so control won't return until it is unloaded or hidden. So, once your form is finished what it's doing, you can just hide it, and control should continue here after the Show method.

Another method to achieve much the same effect is to show the form, then go into a loop (making sure you have a DoEvents statement inside the loop!) until something (such as the form's Visible property) tells you it has been hidden.

You may want to use a slightly different method if you only want to load the form, and not show it. Keep in mind, you could make the form look like a simple "please wait..." indicator or something.

I'll leave it as "an exercise for the reader" as to how you get your boolean value from the form back to the function.

Let us know whether this is any help.
Apr 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
3
by: Torrent | last post by:
When Trying to Load an XSLT File with the XslTransform i got a rather annoying Exception being thrown "System.Xml.XPath.XPathException: XsltContext is needed for this query because of an unknown...
4
by: MLH | last post by:
The following function declaration confuses me... Public Function IsEMailAddress(ByVal sEmail As String, Optional ByRef sReason As String) As Boolean I tried pasting it and its code into an...
19
by: anguo | last post by:
i find in many hash function use 5381,for exampla: static constmap_hash hash(char *pchData, int iLen) { unsigned char cBuf; constmap_hash ulHashId; ulHashId = 5381; while (iLen > 0) { cBuf =...
9
by: Kishor | last post by:
Hi all, I am Using VB.Net for developing my application. I am now needed help. In this project I have to execute some function, but I cannot call them directly using function name, I wanted to...
9
by: Stefan De Schepper | last post by:
Should I use: Private m_Name As String Public Property Name() As String Get Return m_Name End Get Set(ByVal Value As String) m_Name = Value
1
by: Jozef | last post by:
HELP! Hi Folks, I'm having trouble referencing these public variables, and I'm not sure why. I use the code below to set open a connection to a database. The variables are public variables...
12
by: Ima Loozer | last post by:
OK folks here is what I need help with. Lets assume I have a text field that will contain AlphaNumeric data. There is no set pattern to the field such that any given character can be either alpha...
27
by: Terry | last post by:
I am getting the following warning for the below function. I understand what it means but how do I handle a null reference? Then how do I pass the resulting value? Regards Warning 1...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.