|
|
I have a video capturer card SDK.
in the .h file,
defined a class
all functions is in the class.
so i want to know how can i use the function?
because when i use the [Dllimport] to define the function in C#, when running, it doesn't work right,for an exception means "can not found the entrypoint in dll".
so i wondered the reason is the define of Class in dll file.
what can i do then?
the .h file is shown as below:
// AVEControl.h: interface for the AVEControl class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_)
#define AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifdef DEVICECONTROL_EXPORTS
#define DEVICECONTROL_API __declspec(dllexport)
#else
#define DEVICECONTROL_API __declspec(dllimport)
#endif
typedef HRESULT (*AVECALLBACK) (PBYTE pbData, LONG lDataLength);
#define E_DEVICE_NOT_READY 0xB0004001L
class DEVICECONTROL_API AVEControl
{
public:
HRESULT StartRecordWithoutPreview(HWND hWndCap, CString FileName, __int64 pFileLength, UINT pFileMessage, BOOL pShowSetting = TRUE);
HRESULT StartRecordWithPreview(HWND hWndCap, RECT rc, CString FileName, __int64 pFileLength, UINT pFileMessage, BOOL pShowSetting = TRUE);
HRESULT StartPreview(HWND hWndCap, RECT rc);
HRESULT SetVideoClippingWindow(HWND hwnd);
HRESULT SetCallback(AVECALLBACK Callback);
HRESULT GetVideoStatus(PUCHAR pSta);
HRESULT SetVideoPosition(LPRECT lpSRCRect, LPRECT lpDSTRect);
void GetCurrentImage(CString BmpFileFullName);
BOOL IsGraphRunning(void);
HRESULT StopGraph(void);
HRESULT ApplySettings(CString IniFileFullName);
HRESULT SetVideoProcAmp(long Property, long Value);
HRESULT GetVideoProcAmp(long Property, long* Value);
HRESULT GetEvent(long* EventCode, LONG_PTR* Param1, LONG_PTR* Param2, long msTimeout);
HRESULT SetNotifyWindow(OAHWND hwnd, long lMsg, LONG_PTR lInstanceData);
HRESULT InitDeviceControl(void);
AVEControl();
virtual ~AVEControl();
};
#endif // !defined(AFX_AVECONTROL_H__4E171B4B_A11B_49F1_B41C_5F4A31B5CF08__INCLUDED_)
|
|
|
|
|
See my post in the VB forum. Don't cross post, people consider it rude.
|
|
|
|
|
PaulC1972 wrote: Don't cross post, people consider it rude
Talking to yourself???
I guess the OP deleted their post.
|
|
|
|
|
I have to create a control really transparent, it is just a bounding box with handles.
I want show it insiede a panel and i want to see trought the background of the bounding box.
How?
|
|
|
|
|
|
I am at a cross roads with a program I am writing at the moment. I dont know which way to proceed. The information desired is held within File Types under Folder Options in My Computer. I have been tempted to pursue a registry programming approach however. Reading the article on shell extensions and the namespace I would love to be able to glean the information from this method. I have made some inroads into this by setting up the structure:
[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class ExtenManager
{
public const uint SHGFI_ICON = 0x000000100;
public const uint SHGFI_DISPLAYNAME = 0x000000200;
public const uint SHGFI_TYPENAME = 0x000000400;
public const uint SHGFI_ATTRIBUTES = 0x000000800;
public const uint SHGFI_ICONLOCATION = 0x000001000;
public const uint SHGFI_EXETYPE = 0x000002000;
public const uint SHGFI_SYSICONINDEX = 0x000004000;
public const uint SHGFI_LINKOVERLAY = 0x000008000;
public const uint SHGFI_SELECTED = 0x000010000;
public const uint SHGFI_ATTR_SPECIFIED = 0x000020000;
public const uint SHGFI_LARGEICON = 0x000000000;
public const uint SHGFI_SMALLICON = 0x000000001;
public const uint SHGFI_OPENICON = 0x000000002;
public const uint SHGFI_SHELLICONSIZE = 0x000000004;
public const uint SHGFI_PIDL = 0x000000008;
public const uint SHGFI_USEFILEATTRIBUTES = 0x000000010;
public const uint SHGFI_ADDOVERLAYS = 0x000000020;
public const uint SHGFI_OVERLAYINDEX = 0x000000040;
public const uint ILD_TRANSPARENT = 0x1;
[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath,
uint dwFileAttributes,
ref SHFILEINFO psfi,
uint cbSizeFileInfo,
uint uFlags);
}
And Calling it respectively with:
RunningApps.Items.Clear();
IntPtr hTypeInfo; // The Handle To The System FileType List
string fName; // 'the file name to get icon from
SHFILEINFO shinfo = new SHFILEINFO();
// Get All FileExtenstions
foreach (string file in System.IO.Directory.GetFiles("C:\\", "*.*"))
{
hTypeInfo = ExtenManager.SHGetFileInfo(file, 0, ref shinfo,
(uint)Marshal.SizeOF(shinfo), ExtenManager.SHGFI_TYPENAME | ExtenManager.SHGFI_USEFILEATTRIBUTES);
RunningApps.Items.Add(shinfo.szTypeName + " " + shinfo.szDisplayName);
}
Forgive the formatting, This give me the TypeName information which can be found in my computer but is all!. Is it possible to access all the File Extensions along with their information via a call to the shell32 API in My Computer / Folder Options / File Types. Could it be done through PIDL's and if so could someone please help me out!!
<div class="ForumSig"></div>
-- modified at 21:52 Sunday 23rd July, 2006
|
|
|
|
|
Hello People,
I've got an question. I'm working on a program and developed a function. The only thing I can't find the way to call it properly.
This is the function:
private void Stopcontact_Selected(string sender, System.Windows.Forms.PictureBox e)
{
string path = @"C:\C#\DOMO\niks.jpg";
if(licht.Checked)
{
path = @"C:\C#\DOMO\lamp_uit.jpg";
}
else if(gordijn.Checked)
{
path = @"C:\C#\DOMO\gordijn_open.jpg";
}
else
{
path = @"C:\C#\DOMO\niks.jpg";
}
e.Image = Image.FromFile (path);
}
There are multiple images that calls to this function. The hard part is, i can't find the way to send it back to the right image (the one that calls it).
Sorry for my crappy explenation but i'm not so good in english and formuling my questions.
Trick
|
|
|
|
|
What do you mean by 'call it properly' ?
The variable names make me think you started with an event and changed the types of the variables being passed in. That doesn't work. How are you trying to call this code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The way for me to call it is:
this.Stopcontact22.Click += new System.EventHandler(this.Stopcontact_Selected);
this don't work and i don't know the exact way to call it
|
|
|
|
|
This can't work because for it to work, you need to put the signature back as it was, object sender and EventArgs ea. When you change the argument types, it ceases to be an event handler. You need to find another way to do what you're doing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The method that you use to handle the event has to have the same data types for the parameters as the delegate definition. You can't make up your own parameters and expect the event to guess what you are trying to do.
The first parameter is of type object, and is a reference to the control that caused the event. Type cast the reference to the actual data type of the control to access it's members.
---
b { font-weight: normal; }
|
|
|
|
|
|
Activate the port forwarding in router.
For example:
internal : 10.0.0.5 (port 5000)
external : 200.200.200.200 (port 5000)
if the port forwarding is activated, then
the packet to 200.200.200.200(5000) will
be forwarded to 10.0.0.5(5000).
Good luck...
|
|
|
|
|
I dont know much about Routers. I got this complaint when I tried to connect to a computer behind the router.
Please tell me a little bit proceedure to do so.
One more thing, If this is really needed then who other network programs like Yahoo, MSN, eMule work without configuration.
Please guide me in this regard,
Best Regards,
rizwanSharp;
|
|
|
|
|
You must check the manual of your router. The most router has a web configuration. It is easy to configure something like that. Just put your internal IP, put the port, activate and save. That's all.
MSN or Yahoo work through a uPnP protocol. You don't need to activate port forwarding for that.
|
|
|
|
|
uPnP I want to do the same Any Guidance ????
I dont want to force 1000's of clients of my system to configure their routers and imagine if some of them are public properties then how you cna cofigure them ???
Please some more help.
Best Regards,
rizwanSharp;
-- modified at 14:27 Sunday 23rd July, 2006
|
|
|
|
|
That's what I tell you is a normal configuration in a simple router like DSL router.
If you have a 1000 of clients, that means your network is a company network. You
must do more than port forwarding. I don't have any experience like that. Probably
you must change your routing configuration.
|
|
|
|
|
Hmmm OK I check it. And what about Proxy Case?
Any clue if I want to connect to a coputer which is Behind a Proxy server in a LAN but I'm on internet???
Best Regards,
Thanks Alot!!!
rizwanSharp;
|
|
|
|
|
Proxa means : hide your IP, show the IP from proxy.
That means, what you want, is against the concept from proxy.
|
|
|
|
|
hi,
I have written a program of linked list using data structure
but compiler showing following errors
1-> The code has no effect.
2-> statement missing.
3-> Unreachable code.
4-> expression syntax.
Anybody can tell me what can i do for remove these errors from the program.
arun
|
|
|
|
|
Can you share the code?
rizwanSharp;
|
|
|
|
|
Hi!
1->Remove the code since it has no effect
2->Insert the missing statement
3->Remove the code since it's never reached
4->Correct the syntax (count your brackets, for example)
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
arun.m wrote: Anybody can tell me what can i do for remove these errors from the program.
Well, I have an ISP, but I don't have ESP, so I guess you need to post the code. Then I need to ask, what are you writing it for ? If for a class, fair enough. But don't USE your linked list, use the containers built into the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
I Want To create an IVR (Interactive Voice Response) Application in C#
can anybody help me to find some source code or guide me to write that.
thanks
|
|
|
|