|
hi there, thanks again. You replied to me a lot. Can you explain a little bit on generating thumbnail? You have any article so that I can refer to it? Thanks again..
|
|
|
|
|
There's a Microsoft dll that can create thumbnails. I am just getting the code for you, it's C#.
The code I am using, I found on the web. Google for MediaDetClass and yuo should find it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have a frmlogin form, on the login button click it opens a new frmmain form. But my problem is that even after login, it keeps that frmlogin forminstance along with the frmMain form. If i use me.close() on the click of the login button, it closes the entire application and does not show the frmMain form.
My code is as follows:
Dim objcal As FrmMain
objcal = New FrmMain
objcal.ShowDialog()
Me.close()
Where am i going wrong???
Thanks,
Riz
|
|
|
|
|
go to project -> properties in the main menu. In the application tab, change the close on startup form to false.
Posted by The ANZAC
|
|
|
|
|
A good way to do this is to write your own startup code, instead of having it autogenerated. Then you can show the login form, followed by the main form, if appropriate.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Because you use ShowDialog() the entire application is closed because objcal is not shown as a form but as a dialog. Try using Show() instead of ShowDialog().
--Zaegra--
|
|
|
|
|
In Visual studio IDE, click on Project Menu,then click on Project Properties(last option).Now click on Application Tab.
There r a combo related to shutdown mode. select "When Last form Close" option from combo box.
Hope this help u
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Ok, i've been programming for years.... I like to think I know what I'm doing a majority of the time.
However, this issue has me stumped.
I have a file with the current structure:
{
Application= {
Windows=test;
Size=100k;
Location=break;
}
System={
Havok=100;
Desk=10;
{
Cars=ford;
{
trucks=chevy;
}
}
}
}
I have a set of utilities that displays different file in my system with a vb app.
Several of the files I have use the same exact format above.
So, I figured I'd read file in with a io stream and display it in a treeview.
I'd have a root node, then off of that I’d have something like the following.
|-application
|-windows
|-size
|-Location
|-System
|-Havok
|-Desk
|-cars
|-trucks
I wrote a recursive function that would search for “{“, and call it’s self each time until it found a “}”.
It worked ok, but built my tree totally in reverse.
ANY IDEAS OR SAMPLES WOULD BE GREATLY APPRECIATED!
Thanks,
Leonard
|
|
|
|
|
Seems my formatting got hosed up.
Let me try this again.
Ok, i've been programming for years.... I like to think I know what I'm doing a majority of the time.
However, this issue has me stumped.
I have a file with the current structure:
{
Application= {
Windows=test;
Size=100k;
Location=break;
}
System={
Havok=100;
Desk=10;
{
Cars=ford;
{
trucks=chevy;
}
}
}
}
I have a set of utilities that displays different file in my system with a vb app.
Several of the files I have use the same exact format above.
So, I figured I'd read file in with a io stream and display it in a treeview.
I'd have a root node, then off of that I’d have something like the following.
|-application
|-windows
|-size
|-Location
|-System
|-Havok
|-Desk
|-cars
|-trucks
I wrote a recursive function that would search for “{“, and call it’s self each time until it found a “}”.
It worked ok, but built my tree totally in reverse.
ANY IDEAS OR SAMPLES WOULD BE GREATLY APPRECIATED!
|
|
|
|
|
ljohns wrote: It worked ok, but built my tree totally in reverse.
Reverse how? Can you post the code here?
|
|
|
|
|
Here is my code snipet.
Private Sub mnuTableTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTableTest.Click
'********************************************************************
' Start - mnuTableTest_Click
'********************************************************************
Debug.WriteLine("**********************")
Debug.WriteLine("start: mnuTableTest_Click")
Dim xlist As String
'TODO remove hard coded file names
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(sMyFileRoot + myFileName)
Try
xlist = sr.ReadToEnd()
'remove specials
xlist = xlist.Replace(Chr(10), "")
RTrim(LTrim(xlist))
iAdvancementCounter = 0
currentendingpoint = xlist.Length
currentstartingpoint = 0
ProcessBracket(xlist)
rootnode = 0
Finally
sr.Close()
End Try
Debug.WriteLine("end: mnuTableTest_Click")
Debug.WriteLine("**********************")
'********************************************************************
' end - mnuTableTest_Click
'********************************************************************
End Sub
Public Sub ProcessBracket(ByVal mystuff As String)
'********************************************************************
' Start - ProcessBracket
'********************************************************************
Debug.WriteLine("**********************")
Debug.WriteLine("start: ProcessBracket")
Dim i As Integer
Dim xi As Integer
Dim ix As String
Dim suchis As String
Dim NodeName As String
NodeName = ""
suchis = ""
ix = ""
i = 0
xi = 0
'ok.. need to find all the first brackets
'until we find it.. we build node names
'global vars to keep track of file position
Do While currentstartingpoint < currentendingpoint
ix = ""
ix = ix + mystuff(currentstartingpoint)
If iAdvancementCounter = 1 Then
'reset nodename
Debug.WriteLine("NODE: " + NodeName)
AddClassSub(NodeName, rootnode)
NodeName = ""
iAdvancementCounter = 0
End If
If (ix = "{") Then
Debug.WriteLine("Start Root Node: " + Str(rootnode))
rootnode = rootnode + 1
currentstartingpoint = currentstartingpoint + 2
ProcessBracket(mystuff)
End If
If (ix = "}") Then
Debug.WriteLine("End Root Node: " + Str(rootnode))
rootnode = rootnode - 1
iAdvancementCounter = 1
currentstartingpoint = currentstartingpoint + 2
Exit Do
End If
If currentstartingpoint >= currentendingpoint Then Exit Do
NodeName = NodeName + mystuff(currentstartingpoint)
currentstartingpoint = currentstartingpoint + 1
Loop
Debug.WriteLine("end: ProcessBracket")
Debug.WriteLine("**********************")
'********************************************************************
' end - ProcessBracket
'********************************************************************
End Sub
Public Sub AddClassSub(ByVal NodeName As String, ByVal NodeNumber As Integer)
'********************************************************************
' Start - AddClassSub
'********************************************************************
Debug.WriteLine("**********************")
Debug.WriteLine("start: AddClassSub")
Me.tvClass.Nodes.Add(NodeName, NodeName + Str(NodeNumber))
Debug.WriteLine("end: AddClassSub")
Debug.WriteLine("**********************")
'********************************************************************
' end - ProcessBracket
'********************************************************************
End Sub
|
|
|
|
|
From a very quick glance, you are adding a node to the treeview only when you encounter a '}' - this will not produce the tree view that you have described from the input data provided.
Your input data should probably be something like this?
{
Application
{
Windows
{
test;
}
Size
{
100k;
}
Location
{
break;
}
}
System
{
Havok
{
100;
}
Desk
{
10;
{
Cars
{
ford;
{
trucks
{
chevy;
}
}
}
}
}
}
}
|
|
|
|
|
I have a VB.NET 2005 application that makes calls to a VC++ (VC6) DLL and I have that part working fine. The C++ DLL makes use of callback functions to let the VB app know of unsolicited events and that works as well (the functions are at least being called). The problem is I don't know the proper parameters to use (either the C++ or VB side) to get a byte array from C++ back to VB.
I have tried the following:
<br />
C++ side: <br />
BYTE bArray[] = { 11, 12, 13, 14, 15 };<br />
int len = 5;<br />
pfnCallback(bArray, len);<br />
<br />
VB side:<br />
CallbackHandler(ByVal data() as Byte, ByVal len as Integer)<br />
This resulted in the data array length of 1 and it only had the first value of the array no matter how big my array was.
Then I tried:
<br />
C++ side:<br />
SAFEARRAY *psa; <br />
(then properly created psa, and data copied in)<br />
pfnCallback(psa);<br />
(then properly destroy psa)<br />
<br />
VB side:<br />
CallbackHandler(ByVal data() as Byte)
This resulted in the data array length of 1 and it had the first element of C's SAFEARRAY in it (cDim). I could not see my data.
Am I barking up the wrong tree? Is what I want to do possible? I tried ByRef and got exception errors as it jumped from native code to managed code.
Thanks in advance,
Paul
|
|
|
|
|
I think you're looking for this[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Perfect! Thanks for the pointer.
-P
|
|
|
|
|
Does anyone know how to create a given object given nothing but the object type? I'm trying to make a quick way to iterate through my MDI children and if the given form type is not found then i create it and return it...here is what i have so far, but it doesnt seem to work...keeps returning nothing when creating a new form:
Public Shared Function FindFormOfType(ByVal inArray() As Form, ByVal theType As Type) As Form
For Each f As Form In inArray
If f.GetType.Equals(theType) Then
Return f
End If
Next f
Return CType(theType.TypeInitializer.Invoke(Reflection.BindingFlags.CreateInstance, Nothing, Nothing, Application.CurrentCulture), Form)
End Function
-- modified at 20:41 Tuesday 1st May, 2007
Never mind guys, thanks anyways, I found a solution:
Public Shared Function FindFormOfType(ByVal inArray() As Form, ByVal theType As Type) As Form
For Each f As Form In inArray
If f.GetType.Equals(theType) Then
Return f
End If
Next f
Return CType(System.Activator.CreateInstance(theType), Form)
End Function
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Hello all,
I know it seems stupid, but i just cannot update a table of my access database.
I get an error: In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.
The parameter (and then the value of my Agentnummer textbox) has no default value
This is the code:
daAgent.UpdateCommand.CommandText = ("UPDATE Agent " & _
"SET Agentnummer = " & txtAgentnummer.Text & ", " & "Agentnaam = " & txtAgentnaam.Text & _
" WHERE Agentnummer = " & agentNummerOud)
daAgent.UpdateCommand.Connection.Open()
daAgent.UpdateCommand.ExecuteNonQuery()
daAgent.UpdateCommand.Connection.Close()
Maybee this is not the right code at all for updating a table.
Is there anyone who can help?
Thanks!!!
|
|
|
|
|
You're not putting quotes around the string.
Your code is also open to SQL injection attacks. PErsonally, I don't get why anyone uses these update command things, I thnk they suck.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What kind of command do you suppose?
|
|
|
|
|
I would write a proper data layer, all my SQL in stored procs, and then call the methods as I needed them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok, i see.
There is a lot to learn for me.
Thanks for the reply.
|
|
|
|
|
Hello,
I have a form developed in VB .net2003 with SQL Server2000.
I want to work that form both in English and Arabic.Means,a form showing detais in English and it has buttons to save,Modify and Delete.when I click a button 'switch to arabic' the entire form should change to arabic and can do the same operations.
For that ,is there any change in database designing.
Can you please help me.....
Joby Mathew
|
|
|
|
|
HI
I write code to change paper size of printr to custom size and then i define my page heght and width .
Public Sub Print_It()<br />
Try<br />
Try<br />
'PrintFont = New Font("Arial", 10)<br />
Dim pd As PrintDocument = New PrintDocument<br />
'Assign my overloaded version of the standard print controller<br />
Dim dt As DataTable = MyDB.GetTableDaftar()<br />
Dim dv As New DataView(dt)<br />
dv.RowFilter = "id=" + CType(iddaftar, String)<br />
<br />
'Install event handlers<br />
AddHandler pd.BeginPrint, _<br />
New PrintEventHandler(AddressOf Me.pd_StartPrint)<br />
AddHandler pd.PrintPage, _<br />
New PrintPageEventHandler(AddressOf Me.pd_PrintPage)<br />
AddHandler pd.EndPrint, _<br />
New PrintEventHandler(AddressOf Me.pd_EndPrint)<br />
'pd.PrinterSettings.DefaultPageSettings.PaperSize.Width = pd.PrinterSettings.PaperSizes.Item(38).Width<br />
Dim pkCustomSize1 As New PaperSize("Custom", dv(0)(7), dv(0)(8))<br />
<br />
pd.DefaultPageSettings.PaperSize = pkCustomSize1 'Print the document.<br />
If pd.PrinterSettings.IsValid Then<br />
pd.Print()<br />
End If<br />
Finally<br />
'PrintStream.Close()<br />
End Try<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try
but this code does not change the printer paper size
Please help me
if possible with sample
Thanks
-- modified at 4:39 Wednesday 2nd May, 2007
|
|
|
|
|
hi everyone
i need a help ....
how can i use tab control to show datagrid because i have many tab pages that have tabABC, tabDEF, tabGHI,....etc
i want to show in each tab the letter that is related to it
i mean display the datagrid in the tabABC only the names that begins will those letters
can someone helps me please
|
|
|
|
|
I'm not sure what you're asking - you can put a datagrid on a tab page quite easily, and then yuo need to create filtered views of your data that show only the data you're hoping to view. What is your data source ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|