|
The closest your going to get is the StackTrace. It appears that you can't get the line number at all. The old-style Err object in VB6 doesn't work the same way in VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have come out with an office COM to create a custom button in Microsoft Application Eg. Word, Excel. The problem is how can I get the path of the saved document or how can I save the document when I click on my Custom button.
Any one knows what I'm talking about?
Please help.
Thanks
|
|
|
|
|
Each Office application behaves differently.
With Word you need to play with ActiveDocument or Application.Documents to get a Document, then you can invoke the Document.Save and Document.FilePath (I think).
With Excel you have ActiveSheet instead of ActiveDocument. It may also have slightly different functions that you need to call for saving and getting the file path.
Check the MSDN documentation for Office VBA programming. For MS Word http://word.mvps.org/[^] is a great website to help in Word programming.
All the best,
Ed
|
|
|
|
|
Thanks..that helped alot...How about microsoft outlook mail..how do I get the saving path?
|
|
|
|
|
I have an expression which when i assign to Dataview's rowfilter gives an exception. Expression is
DataItemSize like '9%'
it works fine when i pass a string like
DataItemSize like 'g%'
What am i doing wrong?
-- modified at 5:01 Tuesday 27th September, 2005
|
|
|
|
|
Hi,
I am new to VBA. I'm writing a macro that asks a user to login with username and password. Once his username and password is checked, the macro opens another workbook. To run the second workbook, the username and the password of the user has to be present. I want to send the value of the username and password to the second excel workbook. Can anyone please help
By the way, I need open another excel workbook. I am not supposed to do the program in only one excel workbook.
I open the second excel workbook by calling the function below :
Sub example_template()
ChDir "C:\SymbolsExcelReports"
Workbooks.Open Filename:="C:\SymbolsExcelReports\Example_Template.xls"
End Sub
Thanks for helping
ksumputh
|
|
|
|
|
I have a datagrid attached to a database table. I know that there is no such event in datagrid as column resize.
But is there a way that i can capture the datagrid column resize during runtime.
|
|
|
|
|
I'm not 100% sure how it's done but you could try looking up the DataGridColumnStyle.WidthChanged Event in MSDN and playing around with that.
The man who smiles when things go wrong has thought of someone he can blame it on.
If you tell a man there are 300 billion stars in the universe, he'll believe you. But if you tell him a bench has just been painted, he'll have to touch it to be sure.
|
|
|
|
|
I have written and installed a service using VB.NET. I'm no great shakes with Windows services, but I believe I've done everything according to various resources I have consulted.
Problem is that the Windows Service starts up, and within a second or two, stops. When I start it via the SCM I get a popup advising that some services start then stop because they have nothing to do.
My service creates a timer which is supposed to fire every 60 seconds to check and process files in a given location. Apart from setting the timer on startup the service does no other useful work.
Am I supposed to put a never ending loop in the Main() subroutine or something?
|
|
|
|
|
OK, I've created an almost identical Windows Service.
But I did not use a Sub Main as an entry point - just created the typical Service style class. So that might be the source of the problem - I cannot comment on that.
The other thing to look for is if you dragged a Forms timer onto the graphical designer, it will not do squat. You MUST use a System.Timer. VS does not complain, nor does the service throw an error if you used a Forms.Timer, it just simply does not work.
Since I have only created simple timer based services I've never tried to figure out the complexities of debugging one.
I suggest you add an event logger and just write status entries at many points. That has been adequate for me so far in terms of debugging. It may be crude but it is a simple way to figure out exactly what your service is doing...
|
|
|
|
|
Hi ,
I want to develope an urdu/arabic based database application usin vb.net and SQL Server 2000 any one can
help me how i can do this .If anyone can give Code Example in any languge
|
|
|
|
|
You can do it by using Resource files
Resource files have the values for the controls etc.
In resource files u save the value in your desied language
Get the values from these resource files to display.
Hema Chaudhry
|
|
|
|
|
I've almost solved this problem by
using unicode whiles inerting into db and
converting unicodes back to Actuall text while
displaying in a listview. But now i've another problem
if you can solve this , i'll be much thankful to you
as i need an urgen solution .The problem is that
my idea of converting Text to Unide Code then back to
text doesn't work with Crystal reports . If you can help me
how to convert unicodes (Which are now stored in db)
to Actual text for Report.
Many thanx
HMSS
|
|
|
|
|
Sorry but i have no idea about crystal reports
Actually I m also facing this problem
If u get the solution Please Mail me also
Its a great help fro me.
|
|
|
|
|
Sorry but i have no idea about crystal reports
Actually I m also facing this problem
If u get the solution Please Mail me also
Its a great help for me.
hema chaudhry
|
|
|
|
|
Hello everyone,
I'm making a call to a native DLL on a PocketPC 2003 device via pinvoke. I have the call working fine in an eVB demo but it is returning a Not Supported Exception error when I call it in VB.NET.
I'm trying to find some docs on how/why the Not Supported Exception error is thrown but can not find anything useful. Can anyone point me in the right direction?
Thanks!
Ryan Bradley
|
|
|
|
|
This problem evolved through a couple of different error messages.
The NotSupportedException was thrown when I passed a System.String ByRef to a BSTR in the non-COM DLL.
I finally realized that I needed to use a StringBuilder. This resulted in a Native Exception (0xc0000005). Memory wasn't being marshalled properly between the unmanaged stack and the managed heap.
Originally I was using <DllImport("")> and passing StringBuilder ByRef (resulting in Native Exception). I finally got this to work using Declare Function "" and passing StringBuilder ByVal.
I've read through the CF Core Reference and numerous web sites but have not found the defaults that are different between using DllImport and Declare Function .
I did find that MarshalAs is not possible in CF 1.1. I'm stumped why but it works.
Dysfunctional:
<DllImport("ReaderDll")> _<br />
Public Function Read(ByVal strbData as StringBuilder) as Integer<br />
End Function
Functional:
Public Declare Function "Read" Lib "ReaderDll" (ByVal strbData as StringBuilder) as Integer
Ryan Bradley
|
|
|
|
|
When I try to create a new project I get a run time error message that says "Automation server can't create object". What am I doing wrong?
|
|
|
|
|
You don't have the correct references or components defined in your project. You'll need to review them and correct where necessary.
...Steve
|
|
|
|
|
Can a report source be a datasource?
Thanks!
|
|
|
|
|
Property Pt1() As POINT
Get
Return Me._Pt1
End Get
Set(ByVal value As POINT)
If value = Me._Pt2 Then
' TODO: Invalid Point (same as PT2)
Else
Me._Pt1 = value
End If
End Set
End Property
In my property code (above) for the 1st point in my line class, the if statement produces squiggly (wavy underline) warning saying: Operator '=' is not defined for types 'POINT'.
How do you define an 'operator' in a class definition? I have yet to find this concept in the book.
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
It doesn't matter that you are in a class, the error says you can't use = to compare Points.
Taking a quick look at the library for the Point type I see you can use the equals method:
Dim a As New Point(0, 10)<br />
Dim b As New Point(1, 10)<br />
Dim c As New Point(0, 10)<br />
If a.Equals(b) Then Debug.WriteLine(" a = b") Else Debug.WriteLine(" a not = b")<br />
If a.Equals(c) Then Debug.WriteLine(" a = b") Else Debug.WriteLine(" a not = b")
|
|
|
|
|
There is a critical distinction you need to make:
1) Do you want to know if the two objects are really the same? In other words, are you passing in a second reference to a single instance of the object?
2) Do you want to know if the state of two different object instances are identical. In other words, you have two separate object instances, but their property values, i.e their state, is identical.
In the first case there is a comparison operator - "Is". Example
boolTest = m_Object1 Is m_Object2
If this returns true, you have a single object instance that is being referenced by two pointers - m_Object1 and m_Object2.
In the second case, the simplest approach is to write your own validator function in the class that performs a memberwise comparison of two objects, such as
Private Function IsObjectStateIdentical(ByRef MyPoint1 As POINT, ByRef MyPoint2 As POINT) As Boolean
Dim fIsIdentical As Boolean
With MyPoint1
fIsIdentical = (.X = MyOvbject2.X)
fIsIdentical = fIsIdentical And (.Y = MyObject2.Y)
End With
Return fIsIdentical
End Function
|
|
|
|
|
Hi all,
Can any one please tell me how can i add a bacground music with user control (user can control , volume, mute etc) by using VS, VB, ASP.net web application.
Regards
Jennifer Wadhani
jenniferaahmed@yahoo.com
|
|
|
|
|
VB can't play music in a web application. ASP.NET is a server-side only technology that generates HTML for browsers. If you want music in your web page, you'll have to do research on HTML and Web methods of doing that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|