 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
Hi,
I would like to register an XLL while installing a project using MSI.
I am using a VB.NET installer class to do this:
Imports System.ComponentModel
Imports System.Configuration.Install
Imports System.ArgumentException
Imports Microsoft.Office.Interop
Public Class Installer1
Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
MyBase.Install(stateSaver)
Dim targetDir = Me.Context.Parameters.Item("targetdir")
targetDir = targetDir.Substring(0, targetDir.Length - 1)
MsgBox(targetDir)
Dim myScript = targetDir + "MySuperAddin.xll"
MsgBox(myScript)
Dim objAddin As Object
Dim objEXL As Excel.Application = DirectCast(CreateObject("Excel.Application"), Excel.Application)
objEXL.Workbooks.Add()
Try
objAddin = objEXL.AddIns.Add(myScript, True)
objAddin(myScript).Installed = True
Catch ex As Exception
MsgBox("cannot open addin. /n Error: " + ex.Message)
Err_Handler:
MsgBox(Err.Description, vbCritical, "Error: " & Err.Number)
End Try
objAddin = Nothing
objEXL.Quit()
objEXL = Nothing
End Sub
End Class
When I run this code as a VB script on my desktop I dont have any issue.
it is a very standard way to install an addin
please see the link
http://stackoverflow.com/questions/1130301/uninstalling-excel-add-in-using-vbscript[^]
However when I run it during the installation I get
Error: 438 Member not found. (Exception from HRESULTS: 0x80020003 (DISP_E_MEMBERNOTFOUND))
I tried to find a solution using the following links:
1) http://support.microsoft.com/kb/172108[^]
and
2) http://support.microsoft.com/kb/213489/[^]
but NO success. it is a clear problem with OLE Automation Object. I would really appreciate a suggestion. MANY THANKS!!
|
|
|
|
 |
|
 |
My Google foo is failing me.
|
|
|
|
 |
|
 |
IIRC a 64-bit version of the OleDb data provider doesn't exist.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
 |
|
 |
Well, it does.[^]
And normally I would be happy about that, but at the moment it's a bit of a problem to solve.
|
|
|
|
 |
|
 |
I stand corrected.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
 |
|
 |
Curious...why would you want to check?
You're code is going to use the ACE that matches your code bitness. The connection string wouldn't change at all AFAIK.
|
|
|
|
 |
|
 |
It seems that the ACE OleDb that's getting installed with Office is always 32 bits, no matter what your operating system is.
But if you install the Microsoft Access Database Engine 2010 Redistributable you'll have the choice of 32 or 64 bits.
So I want to check not just whether it's installed or not, but also the bitness.
And if it doesn't check I will fallback to Jet OleDb which is preinstalled with the same bitness as the OS.
Or am I missing something obvious here?
|
|
|
|
 |
|
 |
Well, you have no fall back. Why? Bcause you cannot mix 64 and 32-bit code in the same process. This problem is solved at installtime, not runtime.
If your app is compiled as x64 or AnyCPU (and running on a 64-bit O/S), you cannot use the 32-bit drivers. The reverse is also true. If compiled x86 or AnyCPU (and running on a 32-bit O/S), you can't use 64-bit drivers.
The best solution to the problem is to install the requisite software your app needs to run, as is. If your app is compiled x86 or AnyCPU (on a 32-bit machine), then chances are everything is already installed. If your app is compiled AnyCPU (on a 64-bit machine) or x64, then you have to install the Reidistributable engine.
|
|
|
|
 |
|
 |
Does anyone have a LICENCED copy of vsFlexgrid 8 ActiveX surplus to their needs that they wish to sell?
I need to update 1 VB6 prog to run on Win7 but find ComponentOne price is prohibitive for a 1 off job
I understand that this is permitted by the Licence agreement.
Jim
|
|
|
|
 |
|
 |
Hello !
i have finished my application in vb.net 2010 / Net Framework 4 / with Entity Framework 41/ Crystal reports.
on My PC where i have created the application , everything run fine.
now , i want to install and run my application on another PC where Visual studio is not installed .
Except my application , what other packages should i install on other pc to run my application.
Thank you !
|
|
|
|
 |
|
 |
you will more than likely need to make sure that the 4.0 framework is installed and also the crystal reports runtime
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
 |
|
 |
Thank you !
But can you give me some link where to download these packages ?
Thank You !
|
|
|
|
 |
|
|
 |
|
 |
I want to integrate an "old DLL" in which a function is called, in which I must pass two structures ByRef. The functions and structures:
<System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet:=System.Runtime.InteropServices.CharSet.Ansi, Pack:=1)> _
Public Structure BitRec
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> Public iBit() As Integer
Public iState As Integer
Public iTime As Integer
End Structure
<System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet:=System.Runtime.InteropServices.CharSet.[Ansi], Pack:=1)> _
Public Structure MixCalcRec
Public dLeistung As Double
Public dTemp1 As Double
Public dEinlauf As Double
Public dAuslauf As Double
Public dStempelWeg As Double
Public dDrehzahl As Double
End Structure
<System.Runtime.InteropServices.DllImportAttribute("DPCALC", EntryPoint:="_CalcMixData@28", CallingConvention:=System.Runtime.InteropServices.CallingConvention.StdCall)> _
Public Shared Function CalcMixDataDLL(ByRef AnalogData As MixCalcRec, ByVal iArraySize As Integer, ByRef BitArray As BitRec, ByVal iBitSize As Integer, ByVal iMode As Integer, ByVal dbDistance As Double) As Integer
End Function
Public Function CalcMixData(ByRef AnalogData As MixCalcRec, ByVal iArraySize As Integer, ByRef BitArray As BitRec, ByVal iBitSize As Integer, ByVal iMode As Integer, ByVal dbDistance As Double) As Integer
Dim ireturn As Integer = 0
Dim iSizeOfOneStruct1 As Integer = Marshal.SizeOf(GetType(MixCalcRec))
Dim iTotalSize1 As Integer = iSizeOfOneStruct1 * iArraySize
Dim pUnmanagedAnalogDaten As IntPtr = Marshal.AllocCoTaskMem(iTotalSize1)
Marshal.StructureToPtr(AnalogData, pUnmanagedAnalogDaten, False)
Dim iSizeOfOneStruct2 As Integer = Marshal.SizeOf(GetType(BitRec))
Dim iTotalSize2 As Integer = iSizeOfOneStruct2 * iBitSize
Dim pUnmanagedBitDaten As IntPtr = Marshal.AllocCoTaskMem(iTotalSize2)
Marshal.StructureToPtr(BitArray, pUnmanagedBitDaten, False)
ireturn = CalcMixDataDLL(pUnmanagedAnalogDaten, iArraySize, pUnmanagedBitDaten, iBitSize, iMode, dbDistance)
Marshal.FreeCoTaskMem(pUnmanagedAnalogDaten)
Marshal.FreeCoTaskMem(pUnmanagedBitDaten)
CalcMixData = ireturn
End Function
After calling the Function in the DLL wrapper i get an error that I attempted to read or write in protected memory. Can someone help me with that? What am I doing wrong? I think the structures and the DLL declaration are OK. I guess something's wrong in the DLL wrapper.
Thanks for your help.
|
|
|
|
 |
|
|
 |
|
 |
Easy. Don't
VB6 to vb.net ==>logic
vb.net to vb6 ==> very wrong choice
there must be another reason why your program won't work.
Is the framework that you use installed on that other computer.
Jan
|
|
|
|
 |
|
 |
It will be Difficult to impossible to rollback code to previous versions of Visual basic especially from the .net framework to version 6.
If you are adamant on using VB6 then I would look at 3rd party controls to do what you are after.
Sorry but that is my 2 cents on the subject.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
 |
|
 |
There is no direct conversion for the code you posted. You'd have to write your own libraries to duplicate the functionality provided.
Considering you want (for some very bad reason) to use VB6, I'd suggest using a 3rd party control for this, IF you can even find one any more.
Windows 8 will NOT have VB6 runtime support, so I suggest you rethink what you want to support. in the way of Windows versions.
|
|
|
|
 |
|
 |
Actually I created the program to remove the use of third party.
The reason is, you must buy the license.
If that's the case, I'll try to find an another way...
|
|
|
|
 |
|
 |
System.Drawing.Imaging.FrameDimension existed already in .NET 1.1 - hence you can use it from Windows 2000. But you will need a very old version of Visual Studio to create a program targeted to framework version 1.1.
|
|
|
|
 |
|
 |
He's after earlier than that! VB6
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
 |
|
 |
Hi everybody,
I want to populate a datagridview with a generic list(of object), and from different sources I have 2 ways to do so, eitherdataGridView1.DataSource = list or (after binding the datagridview to a bindingsource)
Bindingsource1.Datasource = list Unfortunately both ways won't work for me, and I wonder why. Either way I tried, I refreshed the datagridview afterwards and also controlled that the list was definitely populated.
Does anyone have an idea what might be wrong in my approach?
Thank you
Mick
|
|
|
|
 |
|
 |
I know of two ways to get a DGV automatically display a collection of data:
1.
stuff the data in a DataTable, then simply establish a binding between DT and DGV. Once the DT is fully populated, the DGV columns, their HeaderText, Width, etc are all set automatically.
2.
or have a collection of some type (not: object) with a number of public properties, then give the DGV a number of columns and bind each column to a property of the type in the collection, using DataGridViewColumn.DataPropertyName[^]
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
 |