|
Hi,
I have a simple problem here which i hope to ask :
1. how do I code in c to make my program open a specific file using the default appplication.
2. how do i code in c to make my program open another application.
my program needs to satisfy 2 thing. one is to open a .ra file automatically using the real audio application. two is to open the real audio application only. btw i am using VC6.
Please advise.
Thank you !!
with regards
bk
|
|
|
|
|
ShellExecuteEx() and CreateProcess() might help for 1 and 2 resp.
cheers
|
|
|
|
|
Hi!!!
I am trying to check Internet connection on a system with the InetIsOffline().
But getting errors like
D:\Program Files\Microsoft SDK\include\IntShCut.h(220) : error C2065: 'IUnknown' : undeclared identifier
I have included intshcut.h and linked statically "url.lib". I am using VC 6.0 on Windows 2000 SP4 and IE6. Here is the code snippet
#include "stdafx.h"
#include "Wininet.h"
#include "stdio.h"
#include "stdlib.h"
#include "IntShCut.h"
nt APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
BOOL bConnected;
bConnected = InetIsOffline(0);
/*
Other code
*/
}
I am sniffing a linking problem but have no clue. I have put url.lib in Project /Settings/ Link / library modules.
Thanx in advance.
|
|
|
|
|
You should probably be including unknwn.h .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Nope it does not work either.Still unable to link to intshcut.h.
The error this time
CheckInternetWithInetisOffline.obj : error LNK2001: unresolved external symbol __imp__InetIsOffline@4
Release/CheckInternetWithInetisOffline.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
any more clues?
|
|
|
|
|
Sorry!!! My fault. It worked . I had removed url.lib from the list.
Thanx a lot.
|
|
|
|
|
if you change the Auto Insert Notification for the cd-rom player you need to reboot the system To make it work
switching it on or off is not very easy this way
It is possible to use a trick to avoid restarting windows
But I don’t have any clue how the trick works
Any idea ?
Greets Jeroen
From the netherlands
|
|
|
|
|
I imagine unloading and reloading the CD driver would accomplish the same thing. This is what Windows does, and more, when it is restarted. I'd hazard a guess that there must not be an easy way to reload drivers, otherwise, the CD's auto-notify feature would be using it.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The only problem I have is
That after I write the new value in to the registry
Windows don’t now the value is changed
So windows using the old value
\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer
killing explorer.exe (ctrl + alt + del ) makes it work
I can’t use this option its making windows unstable
So the explorer.exe reloads the data from the registry
Greets Jeroen
|
|
|
|
|
soul_ripper wrote:
The only problem I have is
That after I write the new value in to the registry
Windows don’t now the value is changed
So windows using the old value
Right, and unless the program is coded to periodically check the registry, there's nothing you can do.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hi,
My application access to a web service, using Visual C++ 6.0 and the Soap toolkit. Now I want to deploy it... the problem is that I don't know quite sure which things I have to install ( and install the full toolkit or the sdk doesn't seem to be a good idea ).
What should I install ?
MSXML4 ?
Mssoap1.dll ?
Mssmo.dll ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
Hello everyone,
May i know how to change the background color of an edit control upon a button click? I have added the WM_CTLCOLOR handler and i'm not sure on how to continue with the button click (I mean when i clicked a button, the edit control should change in color). I have found some sources which are not easy to understand. Your reply is greatly appreciated. Thanks!
///////////////////////////////////////////////////////////////
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID() == (int)IDC_EDIT1) // IDC_EDIT1-edit control
{
pDC->SetTextColor(RGB(0, 255, 0));
pDC->SetBkColor(RGB(0, 0, 0));
return (HBRUSH)(m_bkBrush.GetSafeHandle()); // m_bkBrush-CBrush
}
return hbr;
}
|
|
|
|
|
Hi,
the trick is to return the proper hBrush...
create a brush using your back ground color RGB(0,0,0) and then instead of returning
return (HBRUSH)(m_bkBrush.GetSafeHandle()); // m_bkBrush-CBrush
return the created brush
note: create the brush elsewhere (not in the OnCtlColor method, cause it is called 1000000 of times)
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Thanks Yaron for your help. I got it in microsoft visual c++ 6.0. However, when i tried this method of changing color in edit control in microsoft visual c++.NET, i am still unable to change the color in the edit control. Do anyone here knows how to insert a message handler - for instance:WM_CTLCOLOR in microsoft visual c++.NET? C++.NET platform does not have the classwizard, therefore beginners might find it difficult to start up with. Anyway, those who might have trouble with the edit control can refer to the link below:
http://www.codeguru.com/forum/showthread.php?s=&threadid=268470
Thanks for your help and replies! Thanks everyone!
|
|
|
|
|
Hey dudes,
I hope someone out there can make sense of this...
I have plenty of experience with sockets programming,
but I can't seem to figure this out.
I've just added some network code to an open source game,
and everything is working fine except the sockets callback.
I'm reusing old code that works perfectly and the callback
function received events instantly, whereas inside the game
it's lucky to receive it 20 secs late, if at all.
I can slow down the frame-rate to an unplayable 9 fps, then
all the callbacks run, but 4-5 secs late.
Does anyone have any ideas?
Does the CPU usage affect sockets callback?
I'm using Visual C++ on Windows environment, and using
WSAAsyncSelect for my callbacks.
Any help would be greatly appreciated.
SLY.
|
|
|
|
|
|
i don't know many games using directplay!
Don't try it, just do it!
|
|
|
|
|
I am currently using Microsoft Visual C++ 6.0, and having problem with this tool. When I create a new dialog based project, let's say with the name of edits, there will be 3 classes listed in the class view pane, that are:
CAboutDlg, CEditsApp and CEditsDlg. When i add a new handler for a button, either by double clicking the button or through MFC ClassWizard, the classes listed in the class view pane will dissapeared. Sometimes one missing, sometimes two or all. i have to to delete the .ncb and .opt file in the folder where the source code is saved, in order to "get back" all the classes listed previously. Does anyone know what is the problem actually? How to solve it?
Thanks and regards,
Eowyn
|
|
|
|
|
very easy,reinstall vc6.0 or install vc.net.;P
|
|
|
|
|
Hi! I've known this to happen - also in later releases of Visual Studio. Try opening your missing dialog's .h files, modify them (just add a blank space and delete it again), then save. This has made my classes come back in the class view.
Rasmus Therkelsen
rasmus.therkelsen@mail.tele.dk
|
|
|
|
|
eowyn wrote:
i have to to delete the .ncb and .opt file in the folder where the source code is saved
You simply have to do that on a regular basis, thats all.
Its like you want to reboot your windows about once per day - just to be sure.;P
The same company, you know?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Just save the .h file. it works for me
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
Hi, can anyone pls explain 2 me what these public declarations are about? Wat values are being returned and why they are declared in such a way. thanks...
int SetActivePage (int nPage);
int SetActivePage (CMyPropDialog* pPage);
CMyPropDialog *GetPage (int nPage);
CMyPropDialog *GetActivePage (void);
|
|
|
|
|
You aren't serious are you? This is elementary C++ programming. I strongly suggest you find a beginner C++ book and read it.
In the meantime, these are overloaded functions. And the asterix means that the object being passed/returned is a "pointer." (I now feel like Dr. Evil explaining the obvious.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|