What does “Method ‘~’ of object ‘~’ failed” at runtime mean?

That can happen when supporting libraries (dlls or ocxs) are not registered properly or the versions of the installed libraries are different (and incompatible) with the version the app was compiled against originally. Make sure all dependent libraries are registered and the proper version. You may have to recompile the app to make it work … Read more

Why VB6.0 form displays as C# form?

If you have a window handle for the form (from the COM DLL) then you can disable visual styles on that form using the Win32 API: SetWindowTheme( hwnd, “”, “” ); I believe you’ll have to P/Invoke the API. Here’s the definition: [DllImport(“uxtheme.dll”, ExactSpelling=true, CharSet=CharSet.Unicode)] public static extern int SetWindowTheme( IntPtr hWnd, String pszSubAppName, String … Read more

Unload a COM control when working in VB6 IDE

I’m pretty sure there’s no good way to force VB6 to unload the control. Here’s what I do… instead of running Visual C and Visual Basic side-by-side, run VB6 under VC : Load up VC Open the project containing your COM objects Edit, change, etc. In VC, set the Output Executable to be VB6.EXE with … Read more

Block commenting VB/VB.NET code

VB doesn’t have such a construct at the language level. It has single line comments using apostrophe character: ‘ hello world ‘ this is a comment Rem this is also a comment However, Visual Studio has a functionality to automate this task. Select the lines you want and press Ctrl+K+C for commenting and Ctrl+K+U for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)