|
Somebody know how to connect an object pointer of an interface. I got errors at IAMTVTuner get and put.
<code>
Public Sub TvTuner()
Dim hr As Long
Dim pIAMTVTuner As Long
Dim oIAMTVTuner As IAMTVTuner
Dim riidIAMTVTuner As VBGUID
'{211A8766-03AC-11d1-8D13-00AA00BD8339} = IAMTVTuner
riidIAMTVTuner = StrToGUID("{211A8766-03AC-11d1-8D13-00AA00BD8339}")
Dim rclsidWDM As VBGUID
'{266EEE40-6C63-11cf-8A03-00AA006ECB65} = WDM TV Tuner
rclsidWDM = StrToGUID("{266EEE40-6C63-11cf-8A03-00AA006ECB65}")
hr = CoCreateInstance(rclsidWDM, 0, CLSCTX_INPROC_SERVER, riidIAMTVTuner, pIAMTVTuner)
If hr = S_OK Then
Set oIAMTVTuner = GetObject(pIAMTVTuner)
Dim x1 As Long
oIAMTVTuner.get_CountryCode x1 'x1 => -1
oIAMTVTuner.put_Channel 38&, 38&, 38& 'Run-time error '5': Invalid procedure call or argument
End If
End Sub
Public Function GetObject(ByVal pObject As Long) As IAMTVTuner
Dim o As Object
PutMem4 o, pObject
Set GetObject = o
PutMem4 o, 0
Set o = Nothing
End Function
</code>
This is the TypeLib odl-file
<code>
[
uuid(1A4C3A6A-50AE-11D1-BB71-00C04FAD8B08),
version(1.1)
]
library QuartzPropertyTypeLib
{
importlib("StdOle2.tlb");
typedef enum tagTunerInputType
{
TunerInputCable,
TunerInputAntenna
} TunerInputType;
typedef enum tagAMTunerModeType
{
AMTUNER_MODE_DEFAULT = 0x0000, // default tuner mode
AMTUNER_MODE_TV = 0x0001, // tv
AMTUNER_MODE_FM_RADIO = 0x0002, // fm radio
AMTUNER_MODE_AM_RADIO = 0x0004, // am radio
AMTUNER_MODE_DSS = 0x0008, // dss
} AMTunerModeType;
typedef enum tagAMTunerEventType{
AMTUNER_EVENT_CHANGED = 0x0001, // status changed
} AMTunerEventType;
interface IAMTunerNotification;
[
object,
local,
uuid(211A8766-03AC-11d1-8D13-00AA00BD8339),
pointer_default(unique)
]
interface IAMTVTuner : IAMTuner
{
// Gets the supported analog video standards (NTSC/M, PAL/B, SECAM/K1, ...
HRESULT get_AvailableTVFormats(
[out] long *lAnalogVideoStandard
);
// Gets the current analog video standard (NTSC/M, PAL/B, SECAM/K1, ...)
HRESULT get_TVFormat(
[out] long * plAnalogVideoStandard
);
// Scans for a signal on a given channel
// NOTE: this is equivalent to put_Channel(), SignalStrength()
HRESULT AutoTune(
[in] long lChannel,
[out] long * plFoundSignal
);
// Saves the fine tuning information for all channels")]
HRESULT StoreAutoTune();
// The number of TV sources plugged into the tuner
HRESULT get_NumInputConnections(
[out] long * plNumInputConnections
);
// Sets or gets the tuner input type (Cable or Antenna)
HRESULT put_InputType(
[in] long lIndex,
[in] TunerInputType InputType
);
HRESULT get_InputType(
[in] long lIndex,
[out] TunerInputType * pInputType
);
// Sets or gets the tuner input
HRESULT put_ConnectInput(
[in] long lIndex
);
HRESULT get_ConnectInput(
[out] long *plIndex
);
// Gets the video and audio carrier frequencies
HRESULT get_VideoFrequency(
[out] long *lFreq
);
HRESULT get_AudioFrequency(
[out] long *lFreq
);
};
[
object,
local,
uuid(211A8761-03AC-11d1-8D13-00AA00BD8339),
pointer_default(unique)
]
interface IAMTuner : IUnknown
{
// Sets and gets the Channel
HRESULT put_Channel(
[in] long lChannel,
[in] long lVideoSubChannel,
[in] long lAudioSubChannel
);
HRESULT get_Channel(
[out] long *plChannel,
[out] long *plVideoSubChannel,
[out] long *plAudioSubChannel
);
// Gets the minimum and maximum channel available
HRESULT ChannelMinMax(
[out] long *lChannelMin,
[out] long *lChannelMax
);
// CountryCode is the same as the international
// long distance telephone dialing prefix
HRESULT put_CountryCode(
[in] long lCountryCode
);
HRESULT get_CountryCode(
[out] long *plCountryCode
);
HRESULT put_TuningSpace(
[in] long lTuningSpace
);
HRESULT get_TuningSpace(
[out] long *plTuningSpace
);
HRESULT Logon(
[in] HANDLE hCurrentUser
);
HRESULT Logout();
// Signal status for current channel
// signal strength == TUNER_NOSIGNAL, or strength value
HRESULT SignalPresent(
[out] long * plSignalStrength // AMTunerSignalStrength
);
// allow multifunction tuner to be switch between modes
HRESULT put_Mode(
[in] AMTunerModeType lMode // AMTunerModeType
);
HRESULT get_Mode(
[out] AMTunerModeType *plMode // AMTunerModeType
);
// retrieve a bitmask of the possible modes
HRESULT GetAvailableModes(
[out] long *plModes // AMTunerModeType
);
// allow IAMTuner clients to receive event notification
HRESULT RegisterNotificationCallBack(
[in] IAMTunerNotification *pNotify,
[in] long lEvents // bitmask from AMTunerEventType enumeration
);
HRESULT UnRegisterNotificationCallBack(
IAMTunerNotification *pNotify
);
};
[
object,
local,
uuid(211A8760-03AC-11d1-8D13-00AA00BD8339),
pointer_default(unique)
]
interface IAMTunerNotification : IUnknown
{
HRESULT OnEvent([in] AMTunerEventType Event);
};
};
</code>
|
|
|
|
|
how can i set different fonts to different
columns in a data grid ?
i need to show regional language data and english data in one datagrid
|
|
|
|
|
how to show autonumbers in a text control fromm a table in the database
|
|
|
|
|
What do you mean? What is the problem, really? The autonumber property only affects how the value of the field is created, not how you read the field.
---
b { font-weight: normal; }
|
|
|
|
|
Hello there,
I am developing a windows service in vb.net. everything is going fine but one thing. My service starts as soon as computer starts(means without any user even login, which i know is normal for service). What i want to achieve is that i want to get a notification when some user login to the system, and great if i get the user logoff notification but it is not necessary. I want to monitor few programs when they are running and they only run when some user is login. So i want to get notification when some user login so that i can start my monitoring of those programs. Some example code is more then welcome!!
Qaiser.
|
|
|
|
|
One thing you might consider, since it sounds like your not concerned about it running if nobody is logged on, is change the account that the service runs under. So instead of having it run under the local system account, have it run in a user account.
If that is not an option because you want to continue monitoring certain events even if nobody is logged on, then (I dont know of any Loggedon or off events) I would start a new thread and start an infinite loop to check what user is logged on. When you get a different name or you dont get a valid name then raise an event.
-Jason
|
|
|
|
|
Hi,
I have made a website using vb.net (visual studio .net 2003) with a MySQL database. I have built, setup and run the web application in my college as a project. Now I want to deploy the web site on the internet. What are the basic steps I need to know to do so. I have tried to copy all the files from the FTP i am using currently to the FTP server of the hosting company but the website doesnt work on the hosting company's server. It is working absolutely fine on my college server. I have also changed the connection string for the MySQL database connection. What am I missing out... what steps need to be taken in order to get my web site up and running on the hosting company's server? Please help... I am in urgent need. Thanks a lot.
Karan
|
|
|
|
|
We're not the best people to ask about that since each hosting company supports different things.
Your best place is to ask the support staff of the hosting company. This my be a stupid thing to ask, but do they support MySQL?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi there, the hosting supports MySQL and ASP.Net. They do not provide with the setup of the website. I have already transferred my files and code on thier FTP server. Everytime I run the website from the internet, I get a Runtime Error.
I am a student and I am deploying a website for the first time. There must be some modifications that need to be done before I try to run an application on another hosting server/company.
Please help if possible. I will really appreciate any help.
Karan
|
|
|
|
|
Like I said, the best source of help is the hosting company itself. After all, you're paying them aren't you?
You have to determine what the host requires as far as configuration, .NET Framework requirements, and directory structure. We can't possibly tell you that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your help Dave. I'll probably get hold of the hosting company and extract as much help as they can provide me. Thanks again.
|
|
|
|
|
Hi
I want to create a desktop (using CreatDesktop API) and then give the user the ability to move some of the running programs in the Default desktop to that newly created desktop.
I can do it by a CreatProcess to run new files in the created desktop. but how can I move the previously running processes to tthe new desktop?
(I am writing my program in VB6 and I still have not found any way to enumerate the handles of processes in vb6 also.)
Thanks.
|
|
|
|
|
If I read the API docs correctly, you can't move a process to another desktop once it's been created and has made a USER32 or GDI function call. The desktop to use must be specified in the Startup parameters structure before CreateProcess is called to start the app.
Only the process itself can change its desktop using SetThreadDesktop.
You can read more about Window Stations and Desktops here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 10:44 Sunday 22nd January, 2006
|
|
|
|
|
Thanks for the answer.
Yet an other method comes to my mind:
What if a dll is injected into the process? Is that possible then to use the SetThreadDesktop to change the dekstop of the process?
(I don't know much about dll injection, and I would be glad if someone could introduce me some point to start...)
Thanks
|
|
|
|
|
In VB6 code?! Yikes! You're looking at a very rough time doing this.
The problem with Injection is that your code is injected into the Process. You're still not running on the proper thread to call the function. There's just no way to do it that's using any documented methods.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how i chang culture in control panel in runtime in my program
I WANT chang clender type and short date format
22222222222
-- modified at 8:38 Sunday 22nd January, 2006
|
|
|
|
|
Unless your writing a utility to specifically do this and nothign else, you have no business doin this.
Remember, your app is running on a SHARED system. That means your app has to work and play nice with other applications. Changing system-wide settings to overcome deficiencies in your code is just extremely bad practice.
There is no reason to change the culture or short date format in the system. Your code can do anything required by this change itself, if written correctly.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone,
My problem is regarding the conversion of tiff JPEG compression image to LZW. Infact, i know that how can i convert the compressions of tiff image. But the JPEG compression tiff image is the only one which doesn't load in the system.drawing.image class.
Can anyone help me that how can i convert the tiff JPEG compression image to other compression.
Waiting...
|
|
|
|
|
Hi Guys,
If we have a password for the windows (for example), when we try to write the pass, if we had the Caps-Lock Button active, we see a message in a yellow "box", to inform as for this active button, which can make problems in our password!
In one of my programs, I ask somewhere for a password..so I want to show this message to the user,
if his keyboard has the Caps Button active...
I must use tooltip?
Please, give me a solution (with some lines of code if its possible and necessary)
Thanx in advance...
|
|
|
|
|
Why does everyone come around wanting pre-written code all the time?
A simple Google search for "vb.net capslock" comes up with an example here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry, but I am beginner...and I dont understand this exaple and its use..Can you help me more?
|
|
|
|
|
All the examples are going to be just like this. They all have to make calls directly in the Win32 API to get the current status of the lock keys, CapsLock, NumLock, and ScrollLock.
Your best understanding is going to be putting your code together and calling one of the functions, such as GetLockStatus, and step through the code in the debugger.
In the posted example, all you need to worry about calling is GetLockStatus.
Dim status As Boolean
status = GetLockStatus(ToggleKey.CapsLock)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanx Dave Kreskowiak..now I understand! Before, I have problems with the returning value of function (I didnt understand that its boolean) and the way of calling!
And I use google as good as I can..I try.. Thanks again..
|
|
|
|
|
I want the VB.net code for capture of an image taken by a web camera.
-Shonan Vora
|
|
|
|
|
If you're just going to post a demand for code, a Google[^] search for "capture webcam image vb.net" is your next stop.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 10:28 Sunday 22nd January, 2006
|
|
|
|
|