Harsh, but true. In college I also had to do such an assignment together with three young ladies who unfortunately did not even know where to begin. In the end I wound up doing practically everything myself. I even managed to coach them through the discussion of the rsults with the professor, who obviously knew what was going on and simply played along. So we all got a passing grade, but I was the only one who also learned a little.
hi. Dunno how to properly name the question, but here it goes.
I got my lib (dll) exporting function which returns 2 unsigned long values:
1 is a single number and
2 is table which contains a lot of numbers. Basically it looks like this:
DWORD MyFunc(PULONG table, PULONG nr);
then call it:
My dll is written in win32 api. Next i got C# app which have to access to this function.
And here i dont know to do it. Any suggestions?
Uint32 table= new Uint32;
Uint32 nr = new Uint32();
MyFunc(out table, out nr);
crashes C# app.
I'm still working on the subject; seems like it may grow into a series of 3 or more articles.
And it is getting more and more difficult to introduce all of it in a logical order as it all is strongly interconnected.
Luc Pattyn I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Luc, thanks very much, i will try this out
Edit: Now i got "unable to load dll, access to invalid memory location" ;/
This c# is killing me, i cannot even export simple HelloWorld function which return messagebox...
Going to switch back to gtk gui development, thanks anyway for your help guys.
this is my first post here, up to now I have only been reading. My question arose from an argument about my habit to write lines like
if( SomeBooleanvariable == true)
// do something
// do something
Granted, it's a bit verbose, but I did not think it would cause the compiler to generate slightly inefficient code. Looking at the disassembly settled the arguement. It generated the same code in both cases.
When looking at the disassembly I noticed something else. The compiler had inserted some apparently needless NOP instructions. What are they good for? This was taken from the release build:
It has been a while since I really did some assembly on an x86 CPU and I see no immediate use for the NOP at address 0000003b. In the debug build there were more of them, but this one did not disappear in the release build.
Thanks, I thougt of something like this as well, but from the good old days I don't remember any such thing on a x86. Perhaps it's more like getting a pipeline penalty or some other disadvantage when the next instruction is on an odd address. It's just strange that the debug code had several more NOPs, even two in a row at one place.
Thanks, at least some answers, along with many new questions.
I guess the times when you had full control over the actual code are long over. It's just that I don't like being less able to predict what the compiler will generate. Even in the good old times it was never a good idea to trust a computer.
Perhaps it's more like getting a pipeline penalty or some other disadvantage when the next instruction is on an odd address.
There is a penalty when a bitness-changing prefix (edit: just to be clear, a 66 or a 67) is split from an instruction where the ModR/M byte determines whether the length of the instruction is affected by the prefix, by a 16byte boundary
(and there are many other penalties but that's the only penalty I can think of that combines regular instructions and addresses)
Last modified: 2hrs 24mins after originally posted --
I created one custom control which derives from Control class, and I noticed that my control doesn't have location property. How can I add that property? So, when I change that property, control will move to knew location. Problem is I don't know how to get a location of a control in parent control from parent control...
Hmm, about what kind of control are we talking here? Windows Forms or ASP.Net? Or in other words: Does your control inherit from System.Web.UI.Control or from System.Windows.Forms.Control? In case of an ASP.Net control this would actually not be much of a surprise.
I am developing a small application for a small shop and this application requires a small database to store the information. Now I thought that I could work with an mdf file as I think there is no need to install databases like mysql or sqlserver 2005, SLQEXPRESS would meet all the needs. Now my questions is what security measures must I take to make sure that the data isn't compromised. Should I store the mdf file somewhere special when the application is installing? Should the connection string be stored in some special way? And does .mdf files allow you to create users like in SQLServer 2005 (Stupid question I think but asking anyway hehe)
I build an application using Zedgraph and it seem to work fine. I compile and take the exe.file outside the folder containing the Zedgraph dll.
Then the application crashes because it "cannot find Zedgraph". Someting wrong with "Assembly binding". What to do?
Last Visit: 31-Dec-99 18:00 Last Update: 25-Sep-23 20:41