Application happend unavailable parameter in excute runtime - function

After Install shield, I create a application complete and I excute it,
But something like follow picture. I cant debug it, and I cant fint the error what happend.
Someone can tell me, what method to solve it...
1) Like function parameter no use?

Well, I find a rule.
When run the application, the OnCommand Function is early than OnInitDialog function,
the OnCommand will handle static, buttom, listcontrol, color etc.
but My initial variable is in OninitDialog,
So it will append this result.
The solution is declare a variable to avoid into the function, when complete the OninitDialog.

Related

Limit scope of Scilab variables

I use the code
clc;
clear;
getd();
a=1;
b=myFunction();
, where myFunction is defined by
function b=myFunction()
b=a+1;
endfunction
. For some strange reason, this works just fine in Scilab. I believe myFunction simply inherits a from the main function. This is in contrast with for instance Matlab, where a needs to be an input argument of myFunction in order to use it.
I want functions in Scilab to only work with local variables and variables given as input, like in Matlab. So that in this case a is not inherited from the main function.
How can I achieve this?
This works fine in Scilab because in case a function uses an undefined variable the interpreter search it in the calling scope. Although it seems strange, this is how it works and I think this behavior cannot be changed without modifying the source code as #NormalHuman said.
In your example your code is working because you have the "a" variable is defined in the calling scope, but if you execute the function in another situation it could fail. In my opinion a function defined in this way has a defect in its code.
I am using a lot Scilab and I don't see this as a real problem, but I agree with you that this behavior is quite strange and it should not exist.
However, if you are worried of developing incorrectly a function that works well while you are writing the code due to a variable defined in calling scope, the solution for that is to create some unit tests and execute them in a clean interpreter.
You can avoid this by choosing distinct names for variables you wish to be local.
Like putting a myFunction_ in front of all the local variable names. In your example, you would rename a into myFunction_a.
Unfortunately, I don't know if it would be possible to write a script that would do the work for you in case you have large matlab scripts.

Custom control casting exception during DesignTime but not RunTime

Been dealing with a casting exception during design time only that getting me nuts.
I'm trying to create a custom control for winRT (a week view control just like windows phone 8.1). The control works fine during run time but in design time it gives me COMException. During my investigation of the cause of this COMException, I found out that there is a casting exception inside one of the component of my control. This component is a custom listview that implement ContainerContentChanging event. Inside this event there is a casting which raises this exception.
Here is a the custom list view class:-
The code is removed coz the source code is shared below.
The TemplatedListViewEntry cctor look like this one:-
The code is removed coz the source code is shared below.
And the AppointmentModel:-
The code is removed coz the source code is shared below.
OBS!!! while debugging using 2 instance of VS or VS+Blend and put a breakpoint before this line I can see that args.Item is of type ContentControl while during run time it is AppointmentModel.
Could it be a problem with the ItemsSource which is null at design time?
If yes how should I preceed and assign this_ If No, anyone here that can help me figure out what is the problem?
OBS!!! I anyone needs more info please ask and I would gladly share the entire code with you.
Edit 1
Even if i initiate my viewmodel in the cctor of the custom Control, it raises casting exception in Designtime and not in Run tim
Edit 2
After i wrote Edit 1 above i noticed that now i have to Cast exception in two different Styles (CustomWeekView style and TemplatedListView Style) this is if you open Generic.xaml inside Blend. It is really getting annoying and i'm out of thoughts now. That is why i decided to share the source code of this Project, hopfully someone will be able to help looking at it. Below you will see the source code.
CustomWeekView

Unable to use a matlab function

I wanted to move from one point to other on a spherical earth, and when I looked up, I found there is a function named reckon in matlab that does exactly what I need. But when I call it, it says Undefined function 'reckon' for input arguments of type 'double. Which means that maybe the function is not in my library. So I found the m-file from the internet and tried, but then it leads to same error with a different function, which I found the function reckon depends on. So I included that in my folder too, and then again there is a new function missing... and so on.
I have Matlab R2011b.
These functions seem to be in-built matlab functions as they show up in help, but as I'm new to matlab, maybe I'm wrong. What can be done?
As i just wanted to use the functions of the Mapping Toolbox,after some looking up, i found them all in a single package on a website. If any body else wants them too, and don't have the mapping toolbox, you can get all the functions here.
http://mooring.ucsd.edu/software/matlab/doc/toolbox/geo/index.html

How to wait for MySQL To Update in VB.NET?

I have been working on something that checks an MySQL Database to check something - however the program stops responding because it is constantly checking the database. Is it possible to have it wait a few seconds to recheck the database? I have tried sleep() but it is giving a strange error:
A call to PInvoke function
'Game!WindowsApplication1.Form1::Sleep' has unbalanced the
stack. This is likely because the managed PInvoke signature
does not match the
unmanaged target signature. Check that the calling convention
and parameters of the
PInvoke signature match the target unmanaged signature.
I have been looking into this for quite a while and i am in a predicament. I do need the MySQL databases to be checked very often. I tried making a web browser refresh before checking it again - but it started to lag the application.
Code:
function updateit()
' SQL Code goes here, it succeeds.
updateit() ' Update it again.
return true
end
updateit()
Your code example shows a recursive function with no base case. The result of that is always a stack overflow (an uncatchable exception in .Net).
Don't call your updateit() function from within the function itself. Instead, just write a loop to call it over and over.
Try doing your checks from a separate thread. Try dragging a BackgroundWorker onto your form and putting your check in that to make your program more responsive. I've never seen that error before though. Is it System.Threading.Thread.Sleep() or something specific to VB?
Looking at your code it looks like you've got infinite recursion. That will cause a stackoverflow... try
while(true)
'SQL code
end

DB2 Exception handling

The problem that I am facing is primarily on Exception Handling! When an exception occurs I want to put that data in another log table with the error message. However, in DB2 I am not able to figure out a way to retrieve the corresponding error message for the raised SQLSTATE.
PS: I have a stored procedure for this migration and I am not using any other language to call it.
We could do this through SQLERRM in oracle; probably it should be a small thing, still for some strange reasons I have not been able to find it yet!
Hopefully you would have an idea on this, ;-). I just need a pointer on this.
Thanks,
Harveer Uppal
DB2 has an SQLERRM function too. All you need to to is capture all of the tokens from the error and feed them into the function for the equivalent message you'd get from the CLP.
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.sql.rtn.doc/doc/r0022027.html
You should be able to get in the front-end code using DB2Exception.Message property.