Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have a simple program, and I am trying to load the kongregate chat into a WebBrowser, but it is not working...
When I first start it up, it navigates to a game, and then it gives me 4 Script Error, and the chat just sits there saying: "Joining room...". I don't think it is a problem with the browser settings, because it works on internet explorer. Is there something that is messed up with my WebBrowser? I have let it sit there for a few minutes, and it still does not work. I have set the suppressScriptErrors to true and false, and it still does not fix it.
FYI: I am not doing anything bad with my program, like cheating, or spamming, or anything like that, I just want the webpage to show up, and sometimes I like to be able to have things copied, so I put a few TextBoxes to the right of it, so I can paste it into chat, if I won't to post a few things...
This article has the solution to your problem. It appears that the WebBrowser control in Visual Studio launches in IE7 mode by default. That's why you get javescript errors with the control but, not in your browser. I highly suggest you read the article linked that the top. Luckily, there is a fix. The following code was taken from another stackoverflow answer to a question that indirectly addresses your issue. Here is that link, and here is the code.
string installkey = #"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
string entryLabel = Path.GetFileName(Application.ExecutablePath);
System.OperatingSystem osInfo = System.Environment.OSVersion;
string version = osInfo.Version.Major.ToString() + '.' + osInfo.Version.Minor.ToString();
uint editFlag = (uint)((version == "6.2") ? 0x2710 : 0x2328); // 6.2 = Windows 8 and therefore IE10
RegistryKey existingSubKey = Registry.LocalMachine.OpenSubKey(installkey, false); // readonly key
if (existingSubKey == null) {
existingSubKey = Registry.LocalMachine.CreateSubKey(installkey, RegistryKeyPermissionCheck.Default); // readonly key
}
if (existingSubKey.GetValue(entryLabel) == null) {
existingSubKey = Registry.LocalMachine.OpenSubKey(installkey, true); // writable key
existingSubKey.SetValue(entryLabel, unchecked((int)editFlag), RegistryValueKind.DWord);
}
Also, the article I mentioned up top says that you should create an entry for the VS host process for your app too or it won't work in debug mode. Good luck and I hope this solves your issue!
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
We're using the C# version of MPXJ, but rather than examining an existing Project file we're using it to produce a new file purely from code (extracting data from a third party system) for import to Project via MSPDIWriter.
The goal is to have Tasks that report as completed in the other system show up with 100% completion and the ✔ checkmark next to them on the Gantt view when the XML is loaded in Project. This is working as expected only when the total Duration assigned to a task is zero days; for any other duration when Project opens the Task's percentage complete is set to 0%.
Our devs aren't Project people, so it's not clear to us which properties will affect this behaviour:
Task childTask = parent.AddTask();
childTask.Name = sourceItem.Title;
Duration duration = Duration.getInstance(sourceItem.Days, TimeUnit.DAYS);
childTask.PercentageComplete = new java.lang.Integer(childItem.PercentageComplete);
childTask.PercentageWorkComplete = childTask.PercentageComplete;
ResourceAssignment assignment = childTask.AddResourceAssignment(resource);
assignment.Work = duration;
assignment.RemainingWork = duration;
assignment.percentageWorkComplete = childTask.PercentageComplete;
childTask.EffortDriven = false;
childTask.Priority = childItem.Priority;
childTask.Duration = duration;
childTask.BaselineDuration = duration;
if (childItem.PercentComplete == 100)
{
childTask.RemainingWork = Duration.getInstance(0, TimeUnit.DAYS);
}
This sample code works through the steps to create a file from scratch with various combinations of un-started, partially complete, and completed tasks both with and without resource assignments. There is a C# version but I must admit that I haven't kept the two in line. The Java version is probably the more complete, hopefully it should be fairly straightforward to get a working C# version.
I'd suggest starting with these samples and generate MSPDI files from them first, verifying that you get the expected result when the files are imported into MS Project. Hopefully you'll then be able to update your code based on the approach taken in the sample files.
One thing to watch for is that there were some improvements made recently to MSPDI generation relating to getting percent complete to appear correctly so it would be worth verifying that you are working with the most recent version of MPXJ (7.9.2 at the time of writing).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have an application that when initiated, I receive the popup that "https://example.com wants to:"
"Use your microphone"
I have looked at autoit but it has not been helping. I was trying to use an x/y coordinate but no luck. The autoit window info gives me a name and a class but button info is not there.
Anyone have a way around this issue?
Works perfectly:
$WinTitle = "[CLASS:Chrome_WidgetWin_1]"
WinWait($WinTitle)
WinActivate($WinTitle)
ControlSend($WinTitle, "", "", "{TAB}{ENTER}")
Here is how I got around it using AutoIT. Remove one of the Send("+{TAB}") to set it to Block. I tried removing both of these and just using the enter for Allow but it did not work.
Allow Microphone for Chrome:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=chromeClickAllow.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Sleep(2000)
WinActivate("Tabs Outliner")
WinWait("[CLASS:Chrome_WidgetWin_1]")
Sleep(500)
WinActivate("[CLASS:Chrome_WidgetWin_1]")
Send("+{TAB}")
Send("+{TAB}")
Send("{ENTER}")
I have been at this for quite a while. I am using C# for Serious Game Programing, and am working on the SoundManager code found in Chapter 9 of the book, if you want an exact reference. The Code is setting up a sound manager using OpenAl, and I am having a problem with the Alut interface (if that is the right word for what it is). Here is the code that I am working on:
public void LoadSound(string soundId, string path)
{
int buffer = -1;
Al.alGenBuffers(1, out buffer);
int errorCode = Al.alGetError();
System.Diagnostics.Debug.Assert(errorCode == Al.AL_NO_ERROR);
int format;
float frequency;
int size;
System.Diagnostics.Debug.Assert(File.Exists(path));
IntPtr data = Alut.alutLoadMemoryFromFile(path, out format, out size, out frequency);
int errorCode2 = Alut.alutGetError();
//string errorCodeString = Alut.alutGetErrorString(errorCode2);
//System.Diagnostics.Debug.Assert(errorCode2 != Alut.ALUT_ERROR_NO_ERROR);
//System.Diagnostics.Debug.Assert(data != IntPtr.Zero));
//System.Diagnostics.Debug.Write(errorCode2);
Al.alBufferData(buffer, format, data, size, (int)frequency);
_soundIdentifier.Add(soundId, new SoundSource(buffer, path));
}
The issue is this line right here: System.Diagnostics.Debug.Assert(data != IntPtr.Zero));. When this line is not commented out, it always fails. I did have it work, and do not know what I did to change it, and it stopped working. I have posted about this on another post here: Load sound problem in OpenAL
I have looked all over, and from what I can gather, the issue is with the way that OpenAl is working on my system. To that end, I have uninstalled the Tao Framework that I am using to run OpenAl, and reinstalled. I have also done a system restore to as many points as I have back. I have thought about nuking my whole system, and starting fresh, but a want to avoid this if I can.
I Also have found this link http://distro.ibiblio.org/rootlinux/rootlinux-ports/more/freealut/freealut-1.1.0/doc/alut.html#ErrorHandling that has helped me understand more about Alut, but have been unable to get an alut.dll from it, and cannot get any errors to display. This code:
int errorCode2 = Alut.alutGetError();
//string errorCodeString = Alut.alutGetErrorString(errorCode2);
//System.Diagnostics.Debug.Assert(errorCode2 != Alut.ALUT_ERROR_NO_ERROR);
System.Diagnostics.Debug.Write(errorCode2);
Is my attempt to find out the exact error. If I write the code like:
int errorCode2 = Alut.alutGetError();
//string errorCodeString = Alut.alutGetErrorString(errorCode2);
System.Diagnostics.Debug.Assert(errorCode2 != Alut.ALUT_ERROR_NO_ERROR);
System.Diagnostics.Debug.Write(errorCode2);
I may be using the code all wrong to the find the exact error, as I am still learning c#.
Here is what I am looking for:
1)Is this a syntax error or an error with my system
2)If it is an error in my system, are there files that I am not removing when I try to do an uninstall of OpenAL to refresh all the files.
3)How do I get the alutGetError() code to display in such a way that I can actually read what it is.
Thank you for any help beforehand.
I recently ran into the same problem while going through that book and was able to figure it out by logging the error to the output window, notice I through the console.writeline in there.
After doing that I checked the output window which gave me the error code 519. After looking all over I saw a few forum posts recommending I re-install openAl to fix this issue which did the trick, all the links I found didn't work to the download so I had to hunt around but softTonic had the one that worked for me on my windows 7 machine http://openal.en.softonic.com/download
IntPtr data = Alut.alutLoadMemoryFromFile(path, out format, out size, out frequency);
var error= Alut.alutGetError();
Console.WriteLine(error);
//System.Diagnostics.Debug.Assert(data != IntPtr.Zero);
Hope this helps,
helpdevelop
Okay. Well, I know this question has a good chance of being closed within the first 10 minutes, but I am going to ask it anyways for I have spent almost day and an half trying to find a solution. Still, I can't figure this one out. There is not much info on this on the Internet not even on the HASP (safenet) website although they have demos.
I have a HASP HL USB dongle. I try to convert their demo and test run it but for the life of me I simply can't get it to login even. It keeps raising Aladdin.HASP.HaspStatus.HaspDotNetDllBroken exception.
However, if I run the C version of their demo, it works perfectly.
Here is the Csharp version of my code:
Aladdin.HASP;
HASP myHasp = new HASP();
var thestatus = myHasp.Login(vender_code);
myHasp.Logout;
I would like to login to USB HASP and get its HaspID and the settings in its memory.
Thanks in advance,
It might be that you aren't having all dependencies for the HASP runtime. I'm packing with the app:
hasp_windows_NNNNN.dll (NNNNN = your number)
hasp_net_windows.dll
MSVCR71.DLL (added manually)
msvc runtime 80
One runtime library is required by HASP and it doesn't tell you which one unless you put it in the DEPENDS.EXE utility (you probably have you on your Visual Studio installation).
To log in (and read some bytes):
byte[] key = new byte[16];
HaspFeature feature = HaspFeature.FromFeature(4);
string vendorCode = "your vendor string, get it from your tools";
Hasp hasp = new Hasp(feature);
HaspStatus status = hasp.Login(vendorCode);
if (HaspStatus.StatusOk != status)
{
// no license to run
return false;
}
else
{
// read some memory here
HaspFile mem = hasp.GetFile(HaspFileId.ReadOnly);
mem.Read(key, 0, 16);
status = hasp.Logout();
if (HaspStatus.StatusOk != status)
{
//handle error
}
}
Hope it helps. My HASPed software works like a charm. BTW, wasn't able to put envelope around .NET app under no combination of settings.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
We have a Windows based Client-Server Application where the Server is located in a Remote Location and it is being accessed from Clients located at another place, the Database used for this SQL Server.
I would like to do a Performance Test of this Application how can I do that ? Is there a tool available for the same ?
Please suggest
Let's talk about your requirements: You note a performance test, what are your core critical measures of success or failure? Do you have a load profile for your application with the business functions, the number of users and their frequency of occurrence? Typically log files or changes in records within the database can provide an objective measure of frequency of business actions.
The issue of requirements goes directly to your inquiry on performance. Are you interested in the difference of network response time from location a to location b, the time for the sql conversation to complete from a to b, or the end user response time at the same? Is this to be measured under load, or only for a single instance at this distant location? How are you factoring in the uncontrolled element of the complex network between the location of the remote client and the server, for this impacts test reproducibility to a very high degree? Or, is it simply enough to take a 'sniffer' trace for a view of time to last byte of request to time to first/last byte of response for some number of samples over time?
Depending upon your requirements different tools are likely to be called for, from passive tools such as a protocol analyzer, to active test tools for network, for database transactions or even for driving the front end client.
I like HP's Performace Center for this.
I'm sure there are others
You can run a performance monitor on the server. Just add appropriate counters to it (SQLServer.Transactions, etc). Also you can save collected info to log-files.
Check this link for details: Understanding SQL Performance Counters
Also you can integrate PerfCounters into your app. Read this: Performance Counters in the .NET Framework
Here is simple example how you can add PerfCounters to your app:
string category = "My Category", counter = "My Counter";
if (!PerformanceCounterCategory.Exists(category))
{
var ccd = new CounterCreationData(counter, "", PerformanceCounterType.NumberOfItems32);
var ccdcol = new CounterCreationDataCollection() { ccd };
PerformanceCounterCategory.Create(category, "", PerformanceCounterCategoryType.SingleInstance, ccdcol);
}
//else
// PerformanceCounterCategory.Delete(category);
var pc = new PerformanceCounter(category, counter, false) { MachineName = ".", RawValue = 0 };
for (int i = 0; i < 10; i++)
{
pc.RawValue = i;
Thread.Sleep(1000);
}