VB6: Error AxtiveX component can't create object - vb6

I think this is old question but I need to detail my case.
I use the command Set objAcad = GetObject(, "AutoCAD.Application") to call AutoCAD and get error as above.
But this command worked well when PC has admin user but for some security reasons, this right is removed. User only use standard (domain) user.
Only AutoCAD 2006,2007,2008,2009 got this issue. It works on AutoCAD 2015(even domain user).
I used win7 64bit.
Thanks for any support.

Try passing an empty string instead of nothing as the first parameter, i.e.
Set objAcad = GetObject("", "AutoCAD.Application")
According to this reference there is a difference. In your example, if an instance does not already exist, it will return an error, but with the empty string, it will create a new instance (like CreateObject()

Related

xperf -providers doesn't show the name of TraceLoggingProvider defined by TRACELOGGING_DEFINE_PROVIDER

I follow the tutorial to set up a TraceLoggingProvider in my application.
During the application runs, I try to use xperf -providers to see if my user event provider is there:
I cannot see the name I defined in TRACELOGGING_DEFINE_PROVIDER but only the defined GUID is shown. Is it intended?
Instead following another tutorial with WPRP file, I just use xperf -start to capture events. And the same: I can only use GUID as parameter, not the defined name! is it also intended?
Anyway, at the end I can view the result properly in WPA and the defined name of my user event provider is visible.
are all my observaton intended?
The name you use in the C++ code is unrelated to the display name on your pc.
You'd have a displayed name (instead of GUID) if this was a manifested installed provider, but TraceLogging isn't manifested (at least, not in the classical sense - an impromptu manifest is embedded into the image, and sent in the messages).

Launching a GUI application from Windows service

I have read this post and I had little success with the given answer. It said to
use WTSEnumerateSessions to find the right desktop
but all I got was the station name in the WTS_SESSION_INFO struct. The names I saw (e.g. "console", "service") were nothing like the station/desktop names like "Winsta0\default". The answer proceed to state
then CreateProcessAsUser to start the application on that desktop (you pass it the handle of the desktop as part of the STARTUPINFO structure)
I don't think it's referring to a HANDLE variable for the desktop since STARTUPINFO has no members for that. What I think it's referring to is the lpDesktop member which allows you to specify the station/desktop name. Using names returned by WTSEnumerateSessions failed to launch any visible UI, whereas "Winsta0\default" did.
What did I do wrong?
Just tried WTSEnumerateSessions on Windows Seven: my user session (session 1) is named "Console".

Crystal Report Dynamic parameter prompting user name and password

I am using CR 2008. That version allows the use dynamic parameters instead of static parameter. Using that type of parameter will direct CR to go inside the table/view and display what is resided inside the database for us to select the data/information for filtering. That is nice and convenient feature but each time I run the report, I was prompted with server name, user name and password. The user name is the name of the schema and its related password. Those credentials are not supposed to be disclosed to users.
Have anyone come across the same issue and how do you stop CR report from asking for these credentials? It did not ask when I switch to static parameters... the prompt only shows up when dynamic parameters are used.
Thanks!
I finally found a way to get around this issue. In my Crystal report, I used SQL statement in the command for easy future maintenance. I think using command triggers the prompt for user name and password when dynamic parameters is used. I switched to use views for my reports and CR stopped asking me for the credentials. I still favor using commands instead of views though and still curious if there is a way to stop CR from prompting for credential in dynamic parameters when command is used.
Are facing this issue in CR tool or in any other environment which is used to view the report.

Retrieving parameters from a custom URL in TideSDK

I'm putting together a desktop application in TideSDK and am having some trouble finding the parameters passed to the application via a custom launch URL.
The application launches when the appropriate protocol is invoked (call it aaa://), but I haven't been able to figure out how to grab the URL string. I read a couple of threads that suggested I could get the string with the Ti.API.application.getArguments() call, but it returns something odd (see below).
// launch application with aaa://some_args_here
var args = Ti.API.application.getArguments();
// returns (StaticBoundList) [ /path/to/app, "-psn_0_721072", ]
I'm not completely surprised that this doesn't seem to work, as the API documentation says the getArguments method returns a list of command line arguments.
Any insight as to how to access the launch URL would be appreciated!
have a look at window.location.search
https://developer.mozilla.org/en-US/docs/DOM/window.location
It doesn't appear that there's currently an "official" way to do this, so I came up with my own solution that seems to work pretty well (though currently its only implemented for OSX).
Searching through the TideSDK source, I found the place where the native application delegate is created. I added a URL launch handler in the app delegate, which stores the launch URL in a new app delegate member, and connected it to the API with a binding in Ti.UI.
If anybody else is interested in this functionality, or have insights as to how to accomplish this task for Windows, please get in touch!
Although I don't have your problem, just want to say the following function works fine for me.
var args = Ti.API.application.getArguments();
is it possible this is the problem of the urlprotocl registry?
my url protocol is set by this : MSDN
thus the value in "Command" is
"C:\YOUR_APP_FOLDER\YOURAPP.exe" "%1"
tested on win7 and winxp,
both successfully get the arguments.

Why is the scope of a ConnectionString setting always forced to "Application"?

I'm probably not the first one facing this problem, but I couldn't find a proper answer anywhere.
I have a Windows Forms application that uses a strongly-typed DataSet. The designer uses a connection string defined in the application settings. The trouble is that this setting is defined as Application scope (thus read-only), and I need to be able to change it at runtime. In the settings designer, when the type of a setting is "Connection String", it's not possible to change the scope to "User". And the generated dataset doesn't provide a constructor allowing to choose the connection string at runtime, it always uses the one in the settings.
Do you know why MS introduced this restriction? Do you have any workaround?
I'm currently using a workaround that's really ugly: I change the type of the setting to "String", and the scope to "User". That way, I can change it at runtime and it works fine. The trouble is that when I need to modify the dataset in the designer, I have to change it back to "ConnectionString", otherwise the designer doesn't work.
Thanks in advance for your suggestions!
You can change the value of an ApplicationScope setting at runtime. While the generated and strong-typed property is readonly you can use:
Properties.Settings.Default["App1"] = "bbb";
After that, Properties.Settings.Default.App1 will read "bbb";
This should make it possible to leave the design time setting alone.
You cannot use Settings.Default.Save() for ApplicationScope settings but that is intentional. A normal User does not have the privileges to write in a subfolder of Program Files

Resources