|
NO ONE owes you anything. If you want help, play by the rules.
|
|
|
|
|
d@nish wrote: I was labrynth for me to type whole words but alright I will do this.
Frankly you made more sense when you didn't.
"You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
|
|
|
|
|
Throat wobbler mangrove, to you sir!
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
d@nish wrote: And the first person who started this owes an apology I guess.
I guess that would be you. Go on. We're waiting.
Here's a piece of info for you - text speak puts people off answering your questions. You see, now that you have entered full text, I actually want to read what you have said.
|
|
|
|
|
d@nish wrote: And the first person who started this owes an apology I guess.
Frankly, danish, you started this by posting text speak. Someone told you politely not to post your text speak here, as it discourages answers. Don't be offended by that, just learn from this experience and move on. Happy coding.
|
|
|
|
|
no offends man bt dats da way i type
dnt wanna answer alrite no probs
i assume dis aint english learnin site n if it is den i m quite gud at it
n i ll consider dat frm now on
i guess v shudnt waste time in all dis n groom ourselves technically
is it okkkkkkk
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
I think I can speak for everyone else on the board when I say: I only try to decipher this sort of unintelligible crap for pay. My hardship rate is $100/hour, billable upfront, 10hrs minimum contract length. Time spent reading each post will be rounded up to the nearest full hour.
--
Help Stamp Out and Abolish Redundancy
The preceding is courtesy of the Department of Unnecessarily Redundant Repetition Department.
|
|
|
|
|
I think $100 must be changed to 100 kicks(and you know where)
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
Good luck ever getting help from ANYONE on this site again!
|
|
|
|
|
Meh, if they posted another topic, i wouldn't hold this one against them.
Assuming i could read and understand the question.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hi All
i have come across a little problem ..
i am using excel object to create excel file from some data ..
problem is that im using office 2003 object and ma client is using office 2000.
my method
excelworksbook.open()
takes 15 parameter but in 2000 it takes just 13 parametes so it causes problem....
2nd
in excel 2000 the function is cell.value2()
while in 2003 it is cell.value()
client can not use office 2003 and i have no time to completly wewrite the code
SO IS THERE ANY WAY THAT MY APPLICATION CAN WORK FOR Excell 2000 AS WELL
with as minimum changes as possible
explore the world of imagination and be known as creative
|
|
|
|
|
i think u cn get the excel version from the registry and then write code accordingly ie
if(excel 2000 is used){
code here:
}
else{
code here:
}
Chaos, panic and disorder - my work here is done.
|
|
|
|
|
|
im new here i've always liked this site.
sorry but this is very urgent.
It wont throw that exception unless im debugging it with breakpoints, and it will throw prematurely in debug mode with breakpoints. I am using a timer for this. I dont know why it isnt reaching the if statement or its passing it up or something. Thanks for the help in advance.
[code]
private static void SecondChangedEvent(object source, ElapsedEventArgs e)
{
//sleep for 10 milliseconds.
Thread.Sleep(10);
//i use temp to check the seconds.
//error if not setting it to something.
int temp = DateTime.Now.Second;
seconds++;
Thread.Sleep(250);
//will throw an exceptionn if the seconds value is greater than 120.
//But that is handeled in DepositEnvelope().
if(seconds >= 120)
{
Exception ex = new Exception();
throw ex;
}
}
[/code]
|
|
|
|
|
Where is seconds declared and initialized? Is it set anywhere else in code? Where is SecondChangedEvent hooked up to the timer? What is the interval of the timer? What is the scope of the timer?
At first glance I would say that just because you are incrementing "seconds" in your timer handler, it's not a count of actual seconds (even if your timer is suppose to fire every second). It is better to save the start time when you start your timer, then calculate the numer of seconds that has passed.
private DateTime startTime = DateTime.Now;
private static void SecondChangedEvent(object source, ElapsedEventArgs e) {
TimeSpan span = DateTime.Now - startTime;
Int32 seconds = span.TotalSeconds;
}
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
that happened to not work for some reason i have no idea why it still doesn't work. thanks anyway. anyone else have a suggestion.
|
|
|
|
|
Hi,
your code is rather mysterious:
- where is seconds declared and initialized?
- why are you including Thread.Sleep() in an event handler? that is generally a bad idea,
since it disables the normal event processing, and here I see no reason.
- anyway, Thread.Sleep(10) will NOT delay execution for 10 milliseconds; it will be anywhere
from 16 to much much more; you could read my timers article to learn more about it.
- if you want some code to run after 120 seconds have elapsed, why not just store the
time at the start of that period, then compare "now" with start+120 as in:
DateTime endTime=DateTime.MaxValue;
...
endTime=DateTime.Now.AddSeconds(120);
...
if (DateTime.Now >= endTime) {
endTime=DateTime.MaxValue;
...
}
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi!
I'm writing a C# application that is using some functions in a Visual Basic 6 ActiveX dll. The problem is that some of these functions use user-defined types as arguments. How can I call these functions?
I have tried creating a c# Struct that looks exactly like the Type in Visual Basic, but when I try to call the vb-dll-function with this struct as an argument, I get an error message that says something like: "Old format or invalid type library".
|
|
|
|
|
Those types must be public. Since they're COM objects, you should be able to create user-defined types in C#, even though they were defined in VB.
|
|
|
|
|
Hmm, ok...sounds good. Any clue how I can do that?
Simplified the VB6 ActiveX dll-code looks like this:
<br />
Public Type MyType<br />
Text As String<br />
Number As Integer<br />
End Type<br />
<br />
Public Function ShowMsgBox(Msg As MyType)<br />
MsgBox Msg.Text & VbCrLf & Msg.Number<br />
End Function<br />
Calling the function from C# I do like this:
<br />
Type COMType = Type.GetTypeFromProgID("MyDLLProject.MyDLLClass", true);<br />
object UnknownObject = Activator.CreateInstance(COMType);<br />
UnknownObject.GetType().InvokeMember("ShowMsgBox", System.Reflection.BindingFlags.Default | System.Reflection.BindingFlags.InvokeMethod, null, UnknownObject, new object[] {XXXXXXXX});<br />
Where the XXXXXX is I really don't know what to put...
If it would have been ShowMsgBox(Msg As String), then no probs, I'd just put a string there, but now??
-- modified at 6:21 Monday 19th November, 2007
|
|
|
|
|
Instead of doing all this late-binding stuff, just add a reference in your project to your VB6 dll. Visual Studio will use the AxImp.exe tool in the .NET framework to generate a .NET-to-COM interop dll. From there, in C# you can use the types defined in the interop dll as if they were regular .NET types.
|
|
|
|
|
Thanks, sounds a bit easier that way, yes.
Problem is that I would prefer to have a late-binding since the dll won't always be present. It will work as a kind of a "plug-in" that some have and some haven't and I don't want to have to rebuild the whole app depending on which customer is going to have it. :-/
|
|
|
|
|
Have you looked up C# COM late binding? I just did a google search and found a good hit[^].
|
|
|
|
|
Well, I have. I feel like I've googled my brains out for this. All I've found is that it seems to be possible, but not HOW!
Thanks for the link it contains almost what I need, unfortunately it only shows how to pass an ordinary variable (a boolean). My dll requires a user-def type, question is how to "build" a similar type in c# (or how to convert a c# struct to a vb type maybe)?
|
|
|
|
|
I found an "intermediate" solution - to make another dll containing the user-def types (as these aren't changed that often) and add this as a reference in both the C# application and the Vb6 dll.
That way I can call the main dll with late binding, both c# and vb recognize the Type / Struct and I don't have to rebuild the app when I change the dll's functions. Until I decide to change the Types of cause...
It's not the ultimate solution, but I think it'll work.
Thank you for the help!
|
|
|
|