|
If memory serves, this is lifted from the MFC base classes (VC++6) and adapted somewhat:
SetRegKey(HKEY_LOCAL_MACHINE, _T("software\\microsoft\\windows\\currentversion\\app paths\\MYPROG.EXE"), szPathName);<br />
SetRegKey(HKEY_LOCAL_MACHINE, _T("software\\microsoft\\windows\\currentversion\\app paths\\MYPROG.EXE"), szPath, _T("Path"));<br />
<br />
DelRegTree(HKEY_CLASSES_ROOT, _T("MyProg.File"));<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File"), _T("MyProg File"));<br />
<br />
CString szDefaultIconCommandLine;<br />
szDefaultIconCommandLine.Format(_T("%s,-%d"),szPathName,UI_CONFIG_DOCFRAME_ID);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\DefaultIcon"), szDefaultIconCommandLine);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\QuickView"), _T("*"));<br />
<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\open\\ddeexec"), _T("[open(\"%1\")]"));<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\print\\ddeexec"), _T("[print(\"%1\")]"));<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\printto\\ddeexec"), _T("[printto(\"%1\",\"%2\",\"%3\",\"%4\")]"));<br />
<br />
CString szPathDDE = szPathName + _T(" /dde");<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\open\\command"), szPathDDE);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\print\\command"), szPathDDE);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\printto\\command"), szPathDDE);<br />
<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\open\\ddeexec\\application"), szApplicationKeyValue);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\print\\ddeexec\\application"), szApplicationKeyValue);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\printto\\ddeexec\\application"), szApplicationKeyValue);<br />
<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\open\\ddeexec\\topic"), szTopicKeyValue);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\print\\ddeexec\\topic"), szTopicKeyValue);<br />
SetRegKey(HKEY_CLASSES_ROOT, _T("MyProg.File\\shell\\printto\\ddeexec\\topic"), szTopicKeyValue);<br />
<br />
SetRegKey(HKEY_CLASSES_ROOT, _T(".xyz"), _T("MyProg.File"));
a few names have been changed, etc
Any clues?
Steve
|
|
|
|
|
I have an unmanaged C++ project that is largely complete. Up to this point I have used a CVS repository on my local machine to do version control.
I would like to run a series of tests on some past versions of the project, however only the source itself is part of the repository and I can't use the old .vcproj files.
If I check out an old version of the code and add it to a new project, it behaves very differently - sluggish response, takes a lot longer to load and there are different things shown in the output window when debugging. I've changed as many settings as I can think of (it's a multithreaded project, and uses winmm.lib for MIDI etc.) and as far as I can see I've taken this into account. Is there any way I can copy the current project settings, or even the current project file itself and use that without it complaining that most of files no longer exist in the older versions?
|
|
|
|
|
hello friends
i m making my project's backend in vc++ and i want to use gui in VB. so plz guide me that how i can wrap these coding through com wrapper
|
|
|
|
|
|
smarty12 wrote:
i m making my project's backend in vc++ and i want to use gui in VB. so plz guide me that how i can wrap these coding through com wrapper
Make A Com/ATL DLL!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
if you write like following code:
while(1)
{
create a instance of _CommandPtr
create a sql statement and bind it to command object
set command object's prepared attribute to false
execute the command
destroy the command object
......
}
if we use above code and use the same sql statement for command object to run, I want to know whether the db server will cache the sql, i.e. db will not parse the sql every time.
If we change the setting of the prepared attribute to true, whether the db will parse the sql statement?
Thanks.
|
|
|
|
|
I have created a dialog and it's corresponding class, but when I call DoModal(), the dialog does not appear. DoModal returns -1, and GetLastError() returns 1812.
I'm not sure what these codes mean, any help is appreciated.
-Alan
|
|
|
|
|
MSDN says error 1812 is:
1812 The specified image file did not contain a resource section. ERROR_RESOURCE_DATA_NOT_FOUND
Artificial intelligence is no match for natural
stupidity.
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
Try using the "Error Lookup" application that comes with Visual Studio (it's also part of VC6). For 1812, it sounds like the resource for the dialog was not found. This can happen if you manually edit resource.h. Try doing a 'build all' ("rebuild solution" in VS.NET parlance).
Software Zen: delete this;
|
|
|
|
|
Hi I'm italian (sorry for my bad english)
I create a small program that with IFFT and directsound (using CSoundManager & CSound class) make a sound....
After IFFT routine i have an array:
short psOutData = new short[ lSamplesPerSec ];
where there is a wave. I create a CSound class:
ULONG uDataSize = lSamplesPerSec * sizeof( short );
g_pSoundManager->CreateFromMemory( &g_pSound, (BYTE*)psOutData, uDataSize,
pwfx, DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLPAN | DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLVOLUME,
GUID_NULL, 1 );
g_pSound->Play( 1, 1 );
The sound are play correctly (looping)
I have the same problem if the strating level (psOutData[0]) is not 0 but a value...this cause a interference at the beginning.
But this problem is very ugly if I try to change the sound...
I take the sound buffer:
BYTE *pbData = NULL;
BYTE *pbData2 = NULL;
DWORD dwLength;
DWORD dwLength2;
LPDIRECTSOUNDBUFFER pDSB = g_pSound->GetBuffer( 0 );
I lock the buffer:
hr = pDSB->Lock(0, uDataSize, (void**)&pbData, &dwLength, (void**)&pbData2, &dwLength2, 0L );
than I copy a new psOutData (another wave sound) in the buffer:
memcpy( pbData, psOutData, dwLength );
hr = pDSB->Unlock( pbData, dwLength, NULL, 0 );
And new sound are played...but...a "tick" are produced when the new sound starting....why?
I think because the starting level of new wave is different to the play point of old wave...this "jolt" can produce a strange effect during the changing?
How can I do?
There is a method for to avoid this problem?
I hope that someone has understood my problem (I know my english is terrible )...
Thanks to all.
|
|
|
|
|
the "tick" (or click) which you hear at the beginning of your sound is absolutely normal. If you listen carefully, you will also hear a click at the end of your sound eg. when playing a noise. The reason is, that your loudspeaker membrane goes from zero deflection abruptly to a hughe deflection or the other way around at the end of your sound. If you change the sound it is the same. You change the deflection very abruptly. This will always cause a click.
To prevent this effect, one usually "ramp" the signal (kind of fading). A cosine square ramp at the beginning and at the end of your signal will prevent this click (rise ramp:-pi/2 to 0; decay ramp: 0 to pi/2). 5ms ramp duration each should be enough. You can also use a linear rise/decay ramp of this duration. It is not as good as the cosine sqaure ramp but maybe it is a little bit easier to program.
Good luck
|
|
|
|
|
Ok, for start and end I thinck no problem, I can make something...but if i would like to change the sound? How can I be sure that the new sound and the old are the same (maybe similar) to not produce this strange effect? Can I? Or It's impossible?
|
|
|
|
|
You use the DSBCAPS_CTRLVOLUME Flag for your sound buffer. Before you lock the buffer you could try to use SetVolume() in a loop to decrease the level of the sound which is currently playing, then copy your new sound to the buffer, unlock the buffer and use SetVolume() in a loop again to increase the level of your new sound. I haven't tried it before but it should work. If it works you could also use this for the beginning and the end of your wave files. Then you don't have to do the ramping on your own. You can let SetVolume() do the work for you.
|
|
|
|
|
Thank you very much for your help! But I thing thak the problem is another...When I create the sound I make it using the maximum of volume and I play it and, after, i set the volume. I would like set the volume during the play and the SetVolume() can only attenuate it...so...I create at the maximum value and the tick are when I call the Play() It' possible create a sound with a volume and after incrementate it?
|
|
|
|
|
One problem is that the CSound Class sets the Volume inside the play() member function. It is correct to generate the sound with the max volume (max dynamic range of bit resolution). You can send it to the buffer and play it but when you call the play() function you should set the volume to max attenuation. This will only change the attenuation on the buffer. If you set the volume to zero attenuation your sound is of maximal loudness again. After you have used play() in your code, you should immediately call SetVolume in a loop to decrease attenuation. This is not implemented in CSound. You should add a methode where you can independently set the Volume. Eg.:
void CSound::Attenuation(long lVolume)
{
pDSB->SetVolume( lVolume );
}
Then you can adjust Volume from your application.
CSound myCSound;
myCSound-play();
for(int i(-10000); i<0; ++i)
myCSound->Attenuation(i)
I think it should work
|
|
|
|
|
I've installed Visual C++ now I want to install and use Platform SDK WinXP SP2 but I cannot configure it. I've read the installation instructions on MS site.
With my VC I experience the known bug: no folder icons in the Project & Solutions option. I'm trying to add include and lib folders manually by editing the file VCProjectEngine.Dll.Express.Config but I cannot make it work. Well I have done the same for DirectX SDK and the compiler can find the directx include files but it cannot find Windows.h.
Any ideas whats wrong? Have you successfully set up the PSDK with VC2005?
|
|
|
|
|
I could be out on a limb here, but I think that with VC++ 2005 Express Edition, all that you can do is produce Managed C++ applications. Remember it's called Express edition for a reason. The use of the Platform SDK becomes irrelevant, in fact can not even be used.
But my intrepration may be wrong.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
You can produce Win32 programs with Visual C++ 2005 Express by default you can do only console applications and you have to install Platform SDK for Windows.h and the other core platform stuff. There are instructions on MS site how to configure and install it.
The problem is that the beta is buggy and the installation is not straightforward.
|
|
|
|
|
I'm a MFC programmer, and I see many many applications are writen by MFC.
So, does windows form application has the same concept of MDI, SDI ?
After a few years, will most applications be based on windows form?
|
|
|
|
|
this is a .NET notion, but no one tell you this is the only way to program... MFC is FREE !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Currently, we are loading the VxD by explicitly specifying its name in a CreateFile call. What we want to do, is to have VCOMM load our VxD as a port driver, for some COM port. Any COM port will do.
we need to get VCOMM to load our VxD in response to the Open call made by an application on some COM port.
Tell me why
|
|
|
|
|
Could you tell me how can I get system menu by API ?
hmenu = GetSystemMenu(hWnd,1);
hmenu_options_thread1 = GetSubMenu(hmenu,1);
UINT uIDCheckItem;
uIDCheckItem = GetMenuItemID(hmenu_options_thread1,1);
smenu = new TCHAR[21];
GetMenuString(hmenu_options_thread1,uIDCheckItem,smenu,20,MF_BYCOMMAND);
MessageBox(hWnd, smenu,"Menu",MB_OK);
Thank you.
|
|
|
|
|
Hi,
can I get help on how to block and realse the ports for Win 98 OS. From msdn i found that ipseccmd is the utility that could be used for Windows XP and Windows2000 to block/release ports. Similraly, is there any utility available for Windows 98? Or is there any other method by which I can block/relase ports for Windows 98(i.e, any registry enry that helps in blocking ports)???????
Thnx in advance
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|
Just listen to that port and don't accept any connection, then it's "closed" .
The other way is to create a device driver.
Don't try it, just do it!
|
|
|
|
|
Hi,
I need to block both outbound and inbound ports.As you say I can listen in that port and not accept connections to control inbounf traffic on that port.But waht could be done for the outbound traffic?Could you explain more about the device drivers method which you have mentioned?
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|