|
If you are using wpf, then getting the artists into the listbox is as simple as:
lstArtists.ItemsSource = imbd_code.<artist></artist>
If you are using Windows Forms, you will probably need to iterate over the collection and add them manually
For Each aElem In imbd_code.<artist>
'transform aElem into some object to be displayed
lstArtists.Items.Add(transformedObject)
Next</artist>
|
|
|
|
|
just say thanks everyone whos helped i kinda worked out after watching a few of the videos . cheers again . luke
|
|
|
|
|
Hello,
perhaps somebody can help me to find the reason for the crashes I have.
I have a MFC Application with MFC extension DLLs.
One of the dialogs is a window with a CPropertySheet.
One CPropertyPage is a host for ActiveX Controls providing extending UI.
This CPropertyPage has a CWnd member to host the ActiveX Controls dynamically created runtime using the CWnd::CreateControl method.
I have a VB ActiveX Control providing needed extending UI.
It can be loaded and used without problems.
The only problem occurs, when the application exits:
1. The CPropertySheet is destroyed ... the CPropertyPage is destroyed, ...
... which releases its previously queried interfaces,
... sends a WM_DESTROY to the CWnd hosting the ActiveX Control and
... deletes/frees the CWnd
2. Somewhere at the end just before invoking "exit" open "OLE" connections/loaded "OLE" libraries are terminated by Microsoft internal code. I saw that the ActiveX OCX module was active until this moment.
3. In the "exit" invocation the MFC application crashes from within the VB ActiveX Control. The VB ActiveX Control does not execute its UserControl_Terminate handler, so it seems, that there happens an irregular deletion of the VB ActiveX Control.
This crash happens currently only in the debug version of our application. But adding CommonControls to the VB ActiveX Control UI causes a crash even in the release version of this MFC application.
Using a MFC ActiveX Control providing some UI, too, no problems occur.
The only difference seen while releasing the last reference to the previously queried interface are that ...
... the release on the interface of VB ActiveX Control returns 4 still valid references,
... while the release on the interface of the MFC ActiveX Control returns only 3 still valid references.
Thus I suspect, that at application end there is still a last reference valid, not released, which causes a crash after the OCX is unloaded from Microsoft internal code cleaning up before the real application exit.
Something in the VB ActiveX Control wants still to work (like executing UserControl_Terminate), but the OCX is already unloaded.
But ... where and how can I find this last reference?
Debugging through the MFC code hosting the ActiveX Control didn't help really?
Has somebody here experienced a similar problem? Or can somebody help?
Thanks in advance,
Martin
|
|
|
|
|
This question should be asked in the Visual C++/MFC forum. They probably have more experience in hosting VB ActiveX controls than we can give you on how it interacts with the host.
|
|
|
|
|
Hello again,
first - I'm sorry, because I didn't provide any information about the development environment:
Microsoft Visual Studio 6.0 SP6
Microsoft Visual Basic 6.0 SP6
And ... no ... I can not upgrade - currently!
Second - I created a new most simple MFC application only loading the VB ActiveX control and raising an exception on exiting.
It has a CWnd* member on which CreateControl is called and which is deleted while deleting the dialog object.
So it shows the same behavior than the big MFC application I normally work on.
Has someone a hit or suggestion?
Best regards,
Martin
|
|
|
|
|
Hello,
after trying a bit I changed my VB ActiveX Control to execute the "UserControl_Terminate" things in the "UserControl_Hide" event handler.
Only the call "App.LogEvent ..." stayed in the "UserControl_Terminate" event handler.
And now everything seems to work fine.
Even a VB ActiveX Control with CommonControls (not even touched in the "UserControl_Terminate" event handler) works now.
So - I don't know why, but now everything works.
I found a solution, but no understanding for the problem.
Best regards,
Martin
|
|
|
|
|
how do i create a folder on another computer on the network
thanks
|
|
|
|
|
This is the third time you have asked this. The answer you got the first time was correct, so why keep asking? The answer will NOT change.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Quit spamming the boards! Esp. with questions that have already been answered.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi all,
I am creating an object in the runtime using createobject method for excel sheet, im getting a error specifying "ActiveX component cannot create object".
can anyone help me on this one?
line where i am getting the error is:
Set BootExcelApplication = CreateObject("", "EXCEL.APPLICATION")
have tried this also
Set BootExcelApplication = CreateObject("EXCEL.APPLICATION")
thanks and regards,
Preetpal.
|
|
|
|
|
not shure about this but I'm currently creating a programme wich uses excel aswel and got alot of those errors because of language settings.
you can try the following:
'before creating any excel object
Dim oldCI As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")
'create the objects and do your code here
'after everything is done and you don't need to work with excel anymore
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
it fixed it for me so...
|
|
|
|
|
Is excel installed on the machine you are on?
|
|
|
|
|
The correct version is Set BootExcelApplication = CreateObject("Excel.Application") . Is Excel installed on your machine?
|
|
|
|
|
i want export datagridview data in excel sheet in vb.net winforms
|
|
|
|
|
|
hello everyone..
please help me about this.
I have an application that requires cv loader... For example, I have a resume (in any format, txt or doc file), then when I upload it using vb/asp apllication i need to get the name, address and contact number of the person that will be saved in an oracle database...
Is there someone who can give me some hint in creating this functionality
thanks in advance.
jyn
|
|
|
|
|
Please don't cross post. If your question isn't language specific, you should not post it in the language specific forums.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Below is the custom function I call to get data and fill it into a
DataTable. It seems to fail when the FILL command is called, but it
does not fail all the time. It appears to possibly be a length issue
but I am not sure and not sure how to resolve this... your help is
appreciated! Included is the stack trace information below the
function...thank you.
Public Function ExecuteQuery(ByVal strSQL As String, ByVal
myDataTable As DataTable) As Integer
Try
Timing_Start()
Dim myAdaptor As New OdbcDataAdapter(strSQL,
m_objConnection)
myDataTable.Rows.Clear()
'TODO: RUNTIME ERROR: when the SCRIPT column has the
umlaut character
myAdaptor.Fill(myDataTable)
Timing_Stop()
m_iFieldCount = myDataTable.Columns.Count
m_iRecordCount = myDataTable.Rows.Count
'Return (m_iRecordCount)
Return 0
Catch ex As Exception
Error_Show(ex, MsgBoxStyle.Exclamation)
Return (-1)
End Try
End Function
DESCRIPTION:
len
STACK TRACE:
at System.Runtime.InteropServices.Marshal.PtrToStringUni(IntPtr
ptr, Int32 len)
at System.Data.Odbc.OdbcDataReader.internalGetString(Int32 i)
at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i, TypeMap
typemap)
at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i)
at System.Data.Odbc.OdbcDataReader.GetValues(Object[] values)
at System.Data.Common.SchemaMapping.LoadDataRow(Boolean
clearDataValues, Boolean acceptChanges)
at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping
mapping)
at System.Data.Common.DbDataAdapter.FillFromReader(Object data,
String srcTable, IDataReader dataReader, Int32 startRecord, Int32
maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable,
IDataReader dataReader)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable,
IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Expert_Services_Tools.clsConnection.ExecuteQuery(String strSQL,
DataTable myDataTable) in D:\My Documents\Visual Studio Projects
\Siebel Watcher\clsConnection.vb:line 324
SOURCE: PtrToStringUni
John Wadleigh
Siebel Expert
|
|
|
|
|
Whats the error message, does it give you any more info.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It shows the following error message - details were in my first posting. The error occurs on the call to myAdaptor.Fill(myDataTable) but not all the time - only happens when it seems one of the columns returned has a length of characters longer than what might be supported. But I am not sure where this is defined and why I cannot get the data. It appears the problematic column is defined as a 'LONG' database column type so it can have a lot of data in it.
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: len
John Wadleigh
Siebel Expert
|
|
|
|
|
Why are you using the Odbc providers?? Which database are you using??
|
|
|
|
|
It is a SQL Anywhere database. It's a local database file mostly, but eventually I would like to also access Oracle database. However my company mostly deals with these 2 gig local file databases that are SQL Anywhere. So I figured ODBC is the easiest for me and my colleagues to use and setup - that is what we mostly use.
Is there another and perhaps better way?
Thanks.
John Wadleigh
Siebel Expert
|
|
|
|
|
Well, ODBC is the "generic" data provider. There's no performance benefits to using it and the types it uses aren't exactly matched to the types specific to each database implentation. OleDb is the better "generic" provider, while the best to use is the providers for the specific database you're using.
In your case, I would highly recommend using SyBase's .NET data provider for the best compatibility and performance. I think it's found here[^].
The same is true for Oracle.
|
|
|
|
|
I recall trying to make a decision between OleDb and ODBC and for some reason went with ODBC. I went to the Sybase website and searched for .NET developer stuff but only came up with Sybase SQL Anywhere Developer Edition, which I am downloading but not sure if this is what I need.
Here is my problem again but nicely simplified - the error happens on the FILL command...
Dim conn As New Odbc.OdbcConnection("DSN=" & "client_x" & ";UID=" & "SIEBEL" & ";PWD=" & "NEED2CHANGE" & ";")
Dim dr As Odbc.OdbcDataReader
Dim strSQL As String = "select b.name, b.row_id, b.inactive_flg, b.script from SIEBEL.S_APPL_WEBSCRPT b where b.row_id = '1-K3E-1IYQ'"
Dim dt As DataTable
Dim vals() As String
Dim myAdaptor As New Odbc.OdbcDataAdapter(strSQL, conn)
'dt.Rows.Clear()
myAdaptor.Fill(dt)
thanks!
John Wadleigh
Siebel Expert
|
|
|
|
|
sir i make paint brush in vb.net. so i use an array which save dimension of draw ex(line, rectangle, ellipse, brush,eraser etc). so when this array cross size of 510 then my pc works slowly. so i want to use catch memory plz help me for using cache memory.
thanks
Vineet Swami
Isol
|
|
|
|