|
I have a project running which requires me to use a specific .dll file. It is no .COM related .dll file, so I cannot add it to my references list in VS2008.
The .dll file is used by another program to encode and decode packets that will be send over the network. All I know is, is that this .dll file is used for that. If I do a dumpbin, I can see some methodnames that are preceded and followed by non-regular characters. To atleast load the method in my code, I use the ordinal instead with the DllImport.EndPoint parameter.
Now comes in my real problem. I do not know the return value nor the parameters that this method requires. All I get when I try to run invoke it, I get an error indicating VS2008 could not marshal the values I have given.
So, is it possible for me to find out what the return value is of that method and what types of parameters it requires? It is not possible for me to get any hands on documentation, so basically all I have is this .dll file. Note that it is currently used by another program, maybe I can do something with that?
Thank you in advance and I hope it is possible in some way to figure out the return and parameter types for a .dll method.
|
|
|
|
|
Since it's no COM or .NET dll, you can't find out which parameters are used apart from consulting the documentation. You can guess though, but chances that you find out the correct parameter types are extremely small.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I guess dumpbin.exe is used for this purpose. I dont remember the exact command though. Google will help you to get that.
|
|
|
|
|
I used the dumpbin for extracting all the information I can get from it with the -all and -out:destination commands.
From there I got the oridinal codes for the methods (because the method names are messed up a bit).
I do not get any other information from dumpbin, unless it is masekd in there somewhere. If you know how to read the output and convert it somehow in some parameters, that would be awesome.
I have a program that already uses this .dll-file, is it possible to somehow hook between this link so I can see what exactly is sent to the .dll-file? Maybe I can then figure out the parameters by searching for values in the lparam and wparam parameters.
Thank you for your time, if you know something more, please let me know.
|
|
|
|
|
I've found a way to keep custom types working smoothly through web services, and I'd like to know what others think. Maybe this is already obvious common practise... if so, please let me know -- it'd be reassuring. Also: please criticize
1. An assembly "Domain" containing:
class DomainObject { }
interface IDomainProvider
{
void Post(DomainObject do);
DomainObject[] Query(string query);
}
abstract class DomainProvider : ProviderBase, IDomainProvider { ... }
class StubDomainProvider { ... }
2. An assembly "Domain.WebServices" with app.config specifying StubDomainProvider as the default provider:
class DomainWebService : WebService, IDomainProvider { ... }
3. Back in the "Domain" assembly, a web reference to DomainWebService. Since DomainObject uses xml serialization attributes, its schema is nicely preserved: the web reference automatically generates its own DomainWebService.DomainObject class.
4. In the original DomainObject class,
public static explicit operator DomainWebService.DomainObject (DomainObject obj)
{
}
public static explicit operator DomainWebService.DomainObject(DomainObject obj)
{
}
5. Finally, still in the "Domain" assembly,
public WSDomainProvider : DomainProvider { ... }
Pros:
* WSDomainProvider is easy to implement.
Cons:
* DomainObject has to use xml serialization attributes, not IXmlSerializable.
Does any part of this get your spidey-sense tingling? Does it seem like a bad idea in any way? Maybe it makes schema updates more painful than necessary, or maybe putting web references in the Domain assembly is bad practise...
|
|
|
|
|
Hi,
This seems working. Question: Do you want to share the same class on both sides of the web service or do you want to have separate classes which are identical on both sides of web services. This could also be rephrased like, if you modify domain object, do you want the new situation to automatically affect both sides, which would make sense if you define the class in a common assembly which is referenced both in client and server?
Mika
|
|
|
|
|
Thanks! That's the sort of response I'm looking for.
I want to deploy the same assembly to both clients and servers, but I want to be able to update the server assemblies without requiring updates on the clients. I'm pretty sure this is only possible when the update has no effect on the schema. Is this what your question is about?
It'd be nice if I could do things this way and still have server updates that don't break the clients. Keeping this design, the only way I know of is to add a property bag to DomainObject, so any future properties can just be serialized as, say, a list of KeyValuePairs. It makes the XML a bit less clean and the schema validation a less useful...
|
|
|
|
|
Yes, that's what I was asking. By using interfaces you can quarantee that client "sees" the correct data even if you add new properties to classes (as long as you implement the "old" interface).
However, if you don't do any modifications on client side and at the same time you add new data at server side, can the client interpret the new data (so it's fully dynamic at client side)? If so, would it be reasonable to use datataset as web service parameters? This way you wouldn't have to create custom logic to transfer dynamic data.
Mika
|
|
|
|
|
Bluetooth programming for .NET Framework v2.0 in VS2005
I downloaded the Franson Bluetool SDK ( http://franson.com/bluetools/download.asp?platform=net ) and tried the example C:\Program\Franson\BlueTools SDK v1.21\dotNet200\C#\FindAndConnect. No devices are listed after I hit the 'Discover' button and wait a while. Sometimes I get an error message claiming that Bluetooth is disabled. The Bluetooth LED is clearly lit on my laptop and using the systray tool I can connect to other Bluetooth devices. But my applications can't find even one device. I also have a C++ application ( this one http://www.codeproject.com/KB/winsdk/BluetoothAPI__Device_Enum.aspx ) which builds but also can't find even one device when scanning.
Does my systray Bluetooth tool steal the access to the entire Microsoft Bluetooth stack so I have to kill it for my applications to find any devices? (Seems wierd) Shouldn't you be able to establish a Bluetooth connection eventhough it's running?
|
|
|
|
|
Hi,
Who here has used or knows about code that exports a datatable to excel, that handles quotes ". Try any.
I'll appreciate your help.
Let's do this !
|
|
|
|
|
Nice try maite
Original Post Link[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
Nopes, its of today and just 6 hrs back
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Where are you getting the data? If you are querying a database to fill the DataTable then you could perform the Replace when you do the query.
|
|
|
|
|
hi all,
I think this might be the simple question,but i got stuck.Can we pass an interface as a parameter to a method?
Thanks in Advance
|
|
|
|
|
Yes. If the parameter type is an interface then you can pass an object which implements it
|
|
|
|
|
You certainly can, and this is actually good practice if you want to use certain design patterns. For instance, you may want to use the Inversion of Control (IoC) pattern which is heavily pattern based.
|
|
|
|
|
I have some code which has to be able to know whether a file can be opened, if so, open it, if not, try again. In C++ I would use CreateFile() and test if the returned handle was valid. In C# it looks like I would have to use new FileStream() and wait for an exception to be thrown which seems to slow. Is there any way I can instantly tell if a file can be opened?
|
|
|
|
|
File.Open Although it is basically the same thing.
Waiting for the exception will not be slow though. You try to open the file, and if it can't it tells you so in the form of an exception. If no exception is thrown then you know the file has been opened succesfully.
It's probably much better than calling CreateFile then checking the handle.
__DanC__ wrote: Is there any way I can instantly tell if a file can be opened?
The only way is to try and open it. How do you know if a door is locked if you don't try to open it first, psychic powers?
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
That's what I thought, it just seemed slower when catching the exception and retrying.
|
|
|
|
|
|
Thanks for the link but even the referenced articles state that exception handling should not be used used in normal application flow, they should be as the name says "exceptions" whereas in my application it is perfectly possible that another process or thread may have the file open and so I need to retry until it becomes available.
On a side note, when using FileStreams it also seems that the internal file handle is not closed immediately (they are used within a using block) as I get a lot of exceptions opening files that were previously open and are no longer open.
|
|
|
|
|
If the file is opened within a thread you control, then perhaps you could set something up to track which files you have open. Then you could just check against the tracker.
Perhaps this tracker could also fire events so that other threads wouldn't have to keep checking to see if the file is available. Maybe even a waiting list so you can see how many threads are waiting to open a file, you could even prioritize the list.... the possibilities are endless. But err, maybe just a list of files you have open.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Asalamoalekum all,
friends my objective is to achieve indexing of any video(any format DVD, AVI etc) on the basis of the vocal emotions like humourus, tradegic, action. video should be segmented into scenes(in respective categories) on the click with respect to the frequencies spectrums(patterns) of the voices in the video.
can anybody guide me any way to achieve this goal.
how should i take a start to it in C# ??
please highlight basic features that will be required to accomplish my target!
please suggest any software to download which can covert audio frequencies to values!
thanking you!
waiting for reply.......
God bless you all!
regards,
Sana
$@N@
|
|
|
|
|
Can you please explain what your purpose is by indexing video in such a way. May be there is a work around.
Ahsan Ullah
Senior Software Engineer
|
|
|
|