|
Does crystal support RichText Format? If so you could store your forumlas in Rtf or convert to Rtf.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi,
i want to add a comment to DataGrid cell just like in Excell i am using VB.Net 2003 thanks.
Mohammad Al Hoss
|
|
|
|
|
Here[^]
(Didnt saw the link so not sure if it helps)
|
|
|
|
|
This link is for .net 2005 and i am using 2003 but thanks for your help
Mohammad Al Hoss
|
|
|
|
|
Hi,
i have a project in which i mostly use Public Sub or Sub declaration because i am used to it. Most of those subs, could have been actually even Private Sub. Do i gain something if i change those subs(public subs or subs) and make it private sub in performance issue(for example memory)?
thanks in advance...
|
|
|
|
|
No difference in memory or performance.
This is a design issue, not a performance one.
|
|
|
|
|
No differences in performance. But if you are making everything public, you are breaking the OO rules. So only expose the needed methods/properties to the outside than exposing everything.
|
|
|
|
|
Public declaration not effect the performance but it is not a good programming to declare all variable and member declare public.
Thanx
~ Khatri Mitesh
|
|
|
|
|
Hi Friends,
In my VB 6.0 application, I am using database connection in a module. But now i need to place the connection in .ini file so whenver there is a change in connection string i can change .ini file. So pls. help me how to create .ini file for db connection and also how to call that file from my application. Please help me.
Thanks and Regards,
|
|
|
|
|
aaraaayen wrote: In my VB 6.0 application, I am using database connection in a module. But now i need to place the connection in .ini file so whenver there is a change in connection string i can change .ini file. So pls. help me how to create .ini file for db connection and also how to call that file from my application. Please help me.
IIRC, you can use API calls to read INI files from VB6.
HTH
|
|
|
|
|
|
I have a small app that extracts email addresses from the body of any mail message in a folder. That part is working fine.
I now want to extract the email addresses from any attachments also and I am having a problem opening them. (These are bounced email messages, so the real detail is in the attachment. The attachments are generally emails - no word/excel files or anything like that). I just want to get the body of the attachment as a string that I can pass to my regEx based extraction routine.
I have tried:
Private Sub ReadAttachment(ByVal theAttachment as Attachment)
Dim fs As FileStream = File.OpenRead(theAttachment.PathName)
Dim theMsg As String = fs.ToString
SaveEmailAddresses(theMsg)
End Sub
And
Dim theItem As MailItem = CType(theAttachment, MailItem)
Which both fail.
I can't find anything about opening attachments on Google - lots about saving and sending.
Any pointers on how to do this will be welcome.
Cheers.
|
|
|
|
|
After a bit more research, I have half an answer.
What I have managed to (sort of) get working is, save the attachment and then open it as a mail item.
I.E.
Try
theAttachment.SaveAsFile("c:\TempAttachment.msg")
Dim theItem As MailItem = CType(theONS.Application.CreateItemFromTemplate("C:\TempAttachment.msg"), MailItem)
Dim theMessage As String = theItem.Body.ToString
SaveEmailAddresses(theMessage)
Catch ex As InvalidCastException
Dim theFileName As String = String.Concat("c:\TempAttachment", theErrorFile, ".msg")
theAttachment.SaveAsFile(theFileName)
theErrorFile += 1
Catch ex As System.Exception
SaveEmailAddresses("Attachment@Failed.to.Open.com")
theErrorCount += 1
MsgBox(ex.ToString, MsgBoxStyle.Critical, "Error")
Finally
File.Delete("c:\TempAttachment.msg")
End Try
The problem now is that only some of the attachments are being cast as MailItems correctly. The other half throw a InvalidCastException.
As far as I can see, there is little difference between the two types of attachments. Both use the same outlook message window when opened from the saved copy. In the original email, the ones that work have the "email" icon and the ones that don't have a different icon. (Sort of a circle with some wires coming from the top right).
Any one know how I can cast these last attachements as MailItems?
|
|
|
|
|
Does anyone know if there's a painless way to get an instantaneous reading for CPU Utilization? I realise I can use a PerformanceCounter to call .RawValue but I have no idea how to convert that to anything that means anything. I don't want to have to take 2 values (ie. using .NextValue or .NextSample on the performance counter) as I know how to do this (see the example code below)
Dim myCounter As System.Diagnostics.PerformanceCounter = New _
System.Diagnostics.PerformanceCounter()
myCounter.CategoryName = "Processor"
myCounter.CounterName = "% Processor Time"
myCounter.InstanceName = "_Total"
Console.WriteLine(myCounter.NextValue().ToString())
System.Threading.Thread.Sleep(1000)
Console.WriteLine(myCounter.NextValue().ToString())
I realize that the CPU utilization value is a sampled value and *not* an instantaneous one but I'm thinking there must be a way to query whatever value Task Manager currently has - but I can't see a way of doing that?
(If you're wondering, I have a time critical app that I'd like to record a timestamp with current CPU Utilization in a log - the value doesn't have to be perfect but having a value is better than not having one.)
Thanks!
|
|
|
|
|
Well the painless solution would be to jump over the WinAPI cliff and plunge into the fiery depths of Microsoft Windows and trudge through the mountains of commands until you find the correct solution. Or you could google, or you could wait for another more useful response
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Thanks for the answer Thomas. I wanted to trudge through the WinAPI to find something but even with googling didn't really find a good place to start. I ended up coming up with a tiny service app that runs on the computer and tracks CPU Utilization using the counter sampling then responds on a tcp port to a request for the current value. Probably overkill but it beat not having a solution
|
|
|
|
|
Hello,
I have a question timer based. It is a little bit stupid i think but i dont know how i can do it.
I have a Database SQL 2005 in that database there is the following:
ID
Website
Time
So what i need to do, i have to read from the database the first record. the Website that is in there need to be showed for the time that is also read.
After this time the next website must be showed for the next time.When the table read to the end the first record must start again.
I need to have this for showing web pages the one after the other.
I have tried to realise it with Timer function but i didnt managed it to do it.
What i did, in the first timer function i read the record , i showed the webpage.then i stoped the first timer and enabled the second timer with the correct time.After the elapsed time i disable the second timer and enabled the first timer again.
But it seems that there is no stop between the records so the last record is always showed.
I tought when i set Timer1.enabled=false that it stoped at the position is has reached and after enabled it again it wil go further but this is not correct.
Does anyone have a solution. I dont see it anymore. It is a very stupid problem i think but i dont find a solution.In older programming soft like Qbasic there was a command like Pause or wait for x seconds. But i dont find something like that in VB 2005
Thanks
DCA
didiercauberghe@hotmail.com
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim cnpresentatie As New SqlConnection(connectionstring)
Dim cmdalgemeen As New SqlCommand
cnpresentatie.Open()
Dim strQuery As String = "select * from presentatie order by id" ' order by volgorde"
Dim myCommand As New SqlCommand(strQuery, cnpresentatie)
Dim myReader As SqlDataReader = myCommand.ExecuteReader()
While (myReader.Read())
WebBrowser1.Navigate(myReader.GetString(1)) ' volgnummer = hoogste volgnummer per hotel zit op positie 13 in database
Timer2.Interval = myReader.GetValue(2) * 1000
Timer1.Enabled = False
Timer2.Enabled = True
End While
myReader.Close()
cnpresentatie.Close()
'Einde opzoeken kamernummers
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer2.Enabled = False
Timer1.Enabled = True
End Sub
|
|
|
|
|
Why would you need two timers? Do it with a single one...
Hou het simpel.
|
|
|
|
|
The reason i used 2 Timers is because i tought i could stop the proces, the while wend loop and so block the next record until the time was up.
Any ideas, smaal example if possible.
thanks
DCA
|
|
|
|
|
Hi,
I would use a single Windows.Forms.Timer that runs at say 1 second intervals all the time, always
enabled; plus a single variable (say Duration) that keeps the remaining time (in seconds)
for the current item.
in the Tick handler:
1. decrement Duration
2. if it becomes zero/negative:
- read the next record in the Database
- load the new item to show/play/whatever
- set Duration to its required value
That's about it.
|
|
|
|
|
Thanks. for the advice.
This is how i will try to do the thing.
Thanks
DCA
|
|
|
|
|
Hi Everybody!
Being a little bit inexprienced in the .NET Toolbox controls department, i keep stumbling across wonderful C++ Controls and components, only to download them and find that all i get is two .cpp files that i can't figure out how to integrate (if it is ppossible at all) into my vb project.
Is it possible to add C++ Controls to a VB Project, and if so, how?
Thanks Everybody!
MrWolfy
|
|
|
|
|
compile the control(s) into a class library, and then load the resulting .dll file into your VB app. I'm sure someone else will give you a more detailed explaination.
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
|
|
|
|
|
This should be an easy one .. But I've been struggling all night over this ...
- I'm adding menu items during runtime (keeping track of open files)
- I can add the handler for the menu click event - that works ..
Question:
- How can I search / locate for the "newly" added menuitem just by its Menue NAME
[untitled(1)] as an example
- Is the best approach the use of a hash table ? (indexed by menu location ?)
(I haven't tried this yet)
- You would think there is an easy way of searching for the menu name direct ???
Here is how I'm adding the neue menu Item:
MenuName = "untitled(1)" ' Assigne window name
<pre>WindowsToolStripMenuItem.DropDownItems.Add(MenuName) ' add new created window to menue
Any ideas
Thanks
georg
|
|
|
|
|
The best solution would be to name every menu item both uniquely and meaningful. Then iterate through each menu in the menu system for the particular name.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|