|
Constants are constants... It really doesn't matter.
You could also keep them in a class file, between a namespace definition and a class definition. This way, you could keep the constants in a namespace and they would still be usable without creating an object from the class.
It's just a matter of preference...
RageInTheMachine9532
|
|
|
|
|
AFAIK, the constants cannot be stored in TLB (Type Library), but it's possible to use the Public Enum instead.
With best wishes,
Vita
|
|
|
|
|
Hi All
while selecting the components from in the visual basic 6.0 version i m getting error "System error &H80004002 (-2147467262) No such interface supported...."
I have already gone through the following link "http://support.microsoft.com/default.aspx?scid=kb;EN-US;180071" but i didnt get any thing .... my machine is NT 4.0
"Sometimes the love we are looking for its just right in front of us - too close for the eyes to see. So close your eyes & let your heart see for itself."
|
|
|
|
|
Details! Details! Just supplying us with an error message isn't useful. We need to know if this happens for ANY component you try to add, or just a couple? What components are you picking? Are they ActiveX .DLL's?
The above article link you supplied goes to an article about VB5 runtime files. Is this what you intended? I found this[^] article a bit more helpful. If this is the one you went through, did you get any error messages?
Did you try reinstalling Service Pack 6a for NT4 and SP5 for Visual Studio 6?
RageInTheMachine9532
|
|
|
|
|
Hi thanx for the reply..
well frankely speaking i m new into this line...actually i will tell u exactly what happened...... i had downloaded one application from the net and after and while uninstalling that application when i opened the visual basic (6.0) for new project ..........while doing that i just went through the project->components....... i find out the system error message.............. and the other important thing i find out there is .....that there is no components over there..not even a single one............than i type the same error into search group and find out the url of microsoft which i have given in my first query........
i download the particular exe and run that also but still the problem is same............... i can't do anything on my previous projects where i used some components
while running the VB5 file i didnt get any message
my machine is NT 4.0 and visual basic version is 6.0 Enterprise Edition
One more important thing is that i have uninstall the visual basic then, while doing installation of that if i select the Active X components option it was not installing the visual basic successfully also.......but without going for the option of active x components it is installing the visual basic successfully
|
|
|
|
|
Vipin Bokariya wrote:
and after and while uninstalling that application when i opened the visual basic (6.0) for new project
Are you saying that you opened VB6 WHILE the uninstall was going on? If so, this was a bad idea...
When you reinstalled VB6 and then reinstalled it with the ActiveX components selected, what was the error message, exactly?
It looks like your going to have to uninstall and reinstall VB6 again so have your CD's handy. Your also going to have to reinstall SP5 for Visual Studio 6 and SP6a for NT. Have those handy as well.
RageInTheMachine9532
|
|
|
|
|
First My question.
I want to know how i can send messages between computers, a message would used to trigger an event (or send a text message) to the other computer.
How can I send information between 6 computers?
thank you!
-Marvin Guerrero
Then Why I asked!
I am developing a monitoring system. It will be used to monitor surveys and the like such as election results.
Votes Monitoring.
phone calls will be made by agents located at precincts to a call center, a call will include information such as the precinctNO and the number of votes. The information will be encoded into a computer wich belongs to a network, any information saved in an ACCESS database through encoding must reflect on another computer that shows graphs.
The call center will house 6 computers and will operate in a network environment, 5 will serve as data entry(encoding) units and last(Monitor) computer will be used to montior the inputs from the five computers.
The Monitor computer must be able to capture the data as they are saved or in other words display data in real time. I can do this by adding a timer control the refreshes the connection of the Monitor Computer, However.. that would mean that the connection is refreshed even though there is no new data, and that would be inefficient.
I want to apply a method wherein the 5 computers will wend a message to the Monitor PC and only then will the connection be refreshed.
But I don't know how to do that. Its like a chat application.
Marvin N. Guerrero
Hexaven Algo-rythm
|
|
|
|
|
Guerven wrote:
Its like a chat application
Yup. Start there, look for samples of chat applications that already include the basic features of socket communications that you need (here on CP or through Google). On top of such a framework, you might need to consider connection pooling... although in your case, with a known number of clients, you could be safe using a static number of connections and set port #'s to connect to from the clients. If the samples you find don't include or address asynchronous callbacks and threading, look for other samples.
On the other hand, this could be something that is solved using MSMQ/MTS, or whatever that's called now.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Access wasn't designed to be the back-end for anything with multiple users/connections. I would HIGHLY suggest using either MSDE or a full SQL server for that.
RageInTheMachine9532
|
|
|
|
|
I have a check box and a button and a lable that I want they do one thing.
how can i write only one code for them..
for example i want if i click on lable the check box set to true and next time set to false..exactly such as when i click check box..
please help me..
|
|
|
|
|
if you want a click event to occur on more than one object, and it to perform the same code for each event, you must include an array handle. the following is a sample of how to have a click event for a checkbox,button, and label all do the same thing; change the state of the checkbox.
<code> Private Sub MyHugeEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click, Label1.Click
If CheckBox1.Checked = True Then
CheckBox1.Checked = False
Else
CheckBox1.Checked = True
End If
End Sub</code> note the end of the sub declaration line, after handles ("Handles Button1.click, label1.click") you can add more events for objects here for this code to be called once that event occurs.
edit: notice you dont have to include any event handler for the actual checkbox.checkedchange (or click) methods
------------------------
Jordan.
III
|
|
|
|
|
Thanx Jordan
But if i want to have some code in checkbox_chackedchange ...what should I do?
for example..
I have a 2 labels and a check box..
I want if Iclick on checkbox a change a setting, and for that 2 labels too if I click on them that setting get changed...it means the code of chck and labels are the same
help me Please again
|
|
|
|
|
so you want the code to occur under the click events of the labels AND the checkbox..?
ok here you go
Private Sub MyHugeEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click, Label1.Click, CheckBox1.Click
If CheckBox1.Checked = True Then
CheckBox1.Checked = False
Else
CheckBox1.Checked = True
End If
End Sub
NOTE: you MUST set the AutoCheck property of the checkbox to FALSE.
------------------------
Jordan.
III
|
|
|
|
|
i want to invert a color..for example...inveret color.blue
how can i do it?
|
|
|
|
|
The inverse of blue is 0xFFFF00. To invert a colour you need to invert the red, green and blue components individually.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
i was going to suggest that too, Christian. i couldnt figure out how, could you give some detail please? just out of curiousity
thanks
------------------------
Jordan.
III
|
|
|
|
|
To be honest, I don't use VB at all. If it's VB.NET, then you take the Color variable, and you say
myColor.Red = 255-myColor.Red
myColor.Green = 255-myColor.Green
myColor.Blue = 255-myColor.Blue
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
ok thx
ya, i think i tried sumthing similar to that and it didnt work. i guess i can go back and retry with this later.
cheers
------------------------
Jordan.
III
|
|
|
|
|
'Here is a color inverting code. hope this will help
'place a button and 3 textboxes
' then cut and paste this codes
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox3.TextChanged
Try
Button1.BackColor = Color.FromArgb(TextBox1.Text, TextBox2.Text, TextBox3.Text)
Catch
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
TextBox1.Text = 255 - TextBox1.Text
TextBox2.Text = 255 - TextBox2.Text
TextBox3.Text = 255 - TextBox3.Text
Catch
End Try
End Sub
Marvin N. Guerrero
- did the chicken came first than the egg. it depends! uphill the chicken would be first, downhill the egg would simply roll.
|
|
|
|
|
Thanx to all
You Can see a code for getting R ,G ,B from a color and inverting a color in this address:
http://www.vb-helper.com/index_graphics.html#color
XstoneheartX
|
|
|
|
|
Best solution to my Question!
Public Function InvertColor(ByVal C As Color) As Color<br />
Return (Color.FromArgb(255 - C.R, 255 - C.G, 255 - C.B))<br />
End Function<br />
|
|
|
|
|
Hello,
I am writing a program and i need to catch the change clipboard msg to start a event.
The program is a ScreenDump program so you will understand this short qeustion.
I know how to put and get data in or out the clipboard. maybe you can give me a code sample on how the change clipboard msg works after pressing toe Snapshot key.
thank you in advanced.
Jordan2000
|
|
|
|
|
I'm a bit confused...
You're already putting the data on the clipboard and taking it off? If that's the case, why would you need to detect the change in the clipboard? BTW: There is no clipboard changed event...
RageInTheMachine9532
|
|
|
|
|
I am sorry the question was not clear.
ok when i pres on the snapshot key i want that the screendump to be saved.
there is a kinde of hook in the clipboard event that i can tap in but i cant find out how it works.
WMDrawClipboard i found on msdn but the explenation is not clear.
and cant find a soutable code sample fore VB.NET
|
|
|
|
|
Are you saying the when a user presses PrtScrn or Alt-PrtScrn, you want you app to be notified that there is something new on the clipboard?
If that's true, now I understand...
Ummm...OK.
Your going to have to override the WndProc function in your form to receive the WM_DRAWCLIPBOARD message and process it. You'll also need to process WM_CHANGECBCHAIN too if other applications register as clipboard viewers, you can repair the end of the chain if your suddently the last in the chain. You'll need to use the SendMessage, SetClipBoardViewer and ChangeClipboardChain functions, in user32.dll, and GetLastError, in kernel32, to handle this.
What your going to do is when your app starts, call SetClipBoardViewer with the window handle of your form. You'll have to save the return value as this is the handle of the next window in the clipboard viewer chain. Next, call GetLastError to see if what you got back was an error or a null handle.
Now, in you WndProc procedure, when you get the WM_DRAWCLIPBOARD message, you can use the standard .NET Clipboard functions to get the image from the clipboard and display it in a PictureBox if need be. You'll then need to use SendMessage to send the same message you got to the next window in the chain, (remember that return value from SetClipBoardViewer?) unless it's null.
Now, you may be wondering why you have to handle WM_CHANGECBCHAIN. This is because if the next window in the chain is the one that your supposed to send the WM_DRACLIPBOARD to, you'll need to know that it's been removed and you no longer have to send that message, or you'll need to send it to a different window now.
.
.
I've lost you, haven't I...?
Last but not least, when your app quits, you have to remove yourself from the viewer chain. This is done by calling ChangeClipboardChain with your window handle and the window handle of the window your supposed to be forwarding WM_DRAWCLIPBOARD messages to.
Simple, no?
RageInTheMachine9532
|
|
|
|