|
Hi,
I am facing problem with the richtext control. When you save the content with the bullet format, it works but when the same content is extracted from database format is totally lost instead certain unnecessary dot appears?
Help me out !
satan
|
|
|
|
|
My dialog box contains many edit boxes and hence i want to write a general class which inherits from CEdit and allows the user to enter only numeric characters.Please some one advice me on how to implement this.I implemented this to a certain extent where it can control the characters typed but it cannot control the characters entered by pasting into the edit box
|
|
|
|
|
If you use the ES_NUMBER style for the edit box, it only accepts digits.
|
|
|
|
|
i had the same problem about the pasting thing ... i simply fixed that problem
just catch the wm_paste message, open clipboard, clear clipboard en close clipboard.
Hereby noone can paste anything in your edit fields
so you get better control
ehehe
|
|
|
|
|
Did you ever try to enter the perfectly valid number -1.5 ?
< rant >
Whoever Idiot did design that control deserves GUI usability testing for eternity!
And his project manager alike!
They made a special control for entering IP adresses, but failed to provide one for entering numbers. Idiots!
< /rant >
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Handle WM_PASTE, save the content of your control and call CEdit::Default() to do whatever the message wants.
Now you can validate the new content and reject (by copying the saved text back) it or allow it by simply doing nothing.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Hi all,
I am trying to build a project of Visual C++, but its giving very strange error on every .cpp file of the project.
The error is:
fatal error C1033: cannot open program database 'c:\MyWorkspace\business tier\objects\MyProject\release\vc60.idb'
MSDN say this about the error:
====================================
Fatal Error C1033
cannot open program database 'filename'
There was an error opening the .PDB file. This may be caused by a disk error.
=====================================
Can anyone tell what can be the reason of this error?
Ahsan
|
|
|
|
|
Do you have write access to the folder?
Delete existing .pdb files, if any
Italian is a beautiful language. amare means to love, and amara bitter.
sighist | Agile Programming | doxygen
|
|
|
|
|
This is an SDI Application, I am connecting to the Database using a Dialog box, and m_pConn to TRUE if the connecion is established. I want to use the forced connection but have the error.
What I am doing wrong?
how to solve this error:
BOOL CStform::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
_RecordsetPtr m_pRecordset;
CStudentApp *App;
_bstr_t bstrQuery("SELECT * FROM StudV");
_variant_t vRecsAffected(0L);
try {
_CommandPtr m_pCommand;
m_pCommand.CreateInstance (__uuidof (Command));
m_pCommand->ActiveConnection = App->m_pConn; // Formerly opened connection pointer
m_pCommand->CommandText = "Select * From Student";
//m_pRecordset = App.m_pConn->Execute(bstrQuery, vRecsAffected, adOptionUnspecified);
//if (!m_pRecordset->GetadoEOF()) {
}
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
error C2248: 'CStudentApp::m_pConn' : cannot access protected member declared in class 'CStudentApp'
error C2317: 'try' block starting on line '46' has no catch handlers
error C2059: syntax error : 'return'
error C2059: syntax error : '}'
error C2143: syntax error : missing ';' before '}'
error C2059: syntax error : '}'
|
|
|
|
|
there are some things to consider:
1. if you are trying to use the code as you've shown us... the main problem is that App is not initialized when you want to access it...
2. if you are trying to get access to the main application object, then the declaration is not correct:
you should change CStudentApp *App; for extern CStudentApp StudentApp; doing this you'll be accessing the real application object created in OnInitInstance...
3. as the compiler says the try block has no catch... you should catch the exceptions you want to handle... catch(...) for catching all of them.
hope this helps...
|
|
|
|
|
Hello,
I have created an MFC AppWizard(exe) application. It is basically a service and it requires password authentication for installation. I'm able to install it through a GUI installation.
Now I need to install the application through command prompt for e.g.
MyService /install /****
First of all, is there a way I can provide these asterisk in the command line??
What I have done, is created a driver executable (its a win32 console application) named setup.exe
When I issue the install switch to Setup.exe it prompts for a password as follows:
Setup /install
Enter your password => ****
Confirm your password => ****
And creates a bat file (install. bat) at runtime as follows
Contents of install. bat
=======================
Myservice /install/****
And runs the bat file to install the service.
IS THERE A WAY TO DO ALL THE ABOVE OPERATIONS IN A SINGLE STEP BY PROVIDIING THE PASSWORD DIRECTLY TO THE MFC APPLICATION, AVOIDING ALL THESE INTERMEDIATE FILES LIKE MyService /install /****
IN SHORT, IS IT POSSIBLE TO INTERACT WITH THE CONSOLE THROUGH AN MFC APPLICATION?
|
|
|
|
|
I have been unable to pass values from one class to another in a VC++ SDI application.
Actually In one class (say class1) I am constantly getting CString values. I want to pass some of these values to another class (say class3). In class2 , user is setting some rules on the base of which it is decided that whether string shold be passed from class1(list control) to class3(list control).
I have adopted a lot of methods but failed to do so even with a single one. I would prefer array[] to act as a buffer for these values. Plz help me out. But if there is some other easier method, plz suggest.
Reply me soon
|
|
|
|
|
Hi,
I presume you want to store application specific data at a central point. This can be done by using member variables in your CDocument class. Get a pointer to the document in your other classes and you can access the data.
You could/should add some helper functions in your document class to store and retrieve the data.
Woody
|
|
|
|
|
Is there some way change display font setting (dpi), programatically, without restarting windows.
|
|
|
|
|
My colleague hacked an undocumented function about changing fonts in WinNT.
However, in WinNT you have to restart windows.
Maybe, restart is not required on win2K or winXP.
So, read Changing Windows NT Font's Size
|
|
|
|
|
|
Dear All,
Can some body suggest some suitable soultion to below ?
I developed an application to restore wallpaper settings and made this application run as a SERVICE. I am doing following procedure to accomplish this task:
1) Copy HKEY_CURRENT_USER\Control Panel\Desktop
ie . Copy the desktop registry key
2) Saving it to HKEY_LOCAL_MACHINE\SOFTWARE\Desktop
ie. saved it to another key
Now a copy of desktop setting registry is saved in another key.
Now I make changes to my desktop settings. And the value get changed in HKEY_CURRENT_USER\Control Panel\Desktop
3) To restore back my original settigs I restore back the registry (from the copy i made)
ie. Restore registry
On clicking Restore buttton I restore the settings back ie. i copy
HKEY_LOCAL_MACHINE\SOFTWARE\Desktop back to
HKEY_CURRENT_USER\Control Panel\Desktop
--------My problem is that---
If i run this program without making it as a service, then it runs properly. But if I run this program as a service then it doesnot work because I am not able to make changes in HKEY_CURRENT_USER. ie. service doesnot allow.
Is there any other way to restore desktop settings . In any case the program should run as a service.
--------------------------
Please suggest some alternatives.
Rohit
|
|
|
|
|
It's because the service runs as the local system user.
The only way to do what you want, is to make the service log on as a user, then it can change the wallpaperfor that user...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Friends,
Since I am new to SDK I have this doubt. Can we store the string, which we have entered in the “EDIT” window? I have been creating a full application in win32asm. I want to store the contents of the “EDIT” box and append it to the SQL statement. I don’t know how can I store the “EDIT” box content that is text entered in EDIT box.
Help.
|
|
|
|
|
This is a Visual C++ forum. Not an ASM forum...
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
That is OK since the functions are the same from .dll files. All win32asm does is call the .dll function during the run time. If some body knows how to retrieve the text inputted in “EDIT”. I was searching the MSDN (platform SDK) but I cannot make a way.
|
|
|
|
|
IF you are using the common edit control/box. Then sending a WM_GETTEXT command to the edit cotrol will work. Some edit controls require you to first select the text, via a function call, that you what to copy and the call a function like GetSelectedText(). All of this information should be available online at microsoft, incase you do not have access to the MSDN library.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hello All,
When I am playing around the Microsoft's demo program "walkall", I include its CApp and CWinSink class into my program (as two classes). And in my program, I write a procedure (such as MyParse()) that calls the modified main function in the original walkall program (which now, is a ordinary function of the CApp class in my program).
I find that when I first run MyParse(), all goes good. When I run it again, no result. After debuging, I find the call to "CoCreateInstance" in the walkall (which is a class of my program) will fail when it is called in a second time.
As I am quite unfamiliar with the COM and related thing, can anyone know what is the most possible reason for it?
From the MS help, it says the "CoCreateInstance" will return 3 possible results:
S_OK
REGDB_E_CLASSNOTREG
CLASS_E_NOAGGREGATION
However, I checked the returned value, it is none of the above three values.
How can I know why CoCreateInstance will fail?
Thanks a lot.
And have a nice day.
|
|
|
|
|
The return value from CoCreateInstance is an HRESULT, which normally contains error information. Get the return value, then you can look it up in the error lookup program (from the Tools menu in VC6).
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
As said by Dave, CoCreateInstance() can return any possible HRESULT value. The most common HRESULT values are S_OK , S_FALSE and E_FAIL . You can use the error look up table or check the hr value of your returned HRESULT in your watch window while debugging.
For example:
<br />
HRESULT hRes = CoCreateInstance(.....);<br />
insert in your watch, a variable hRes,hr and check the error string when you pass the CoCreate statement.
Also make sure you are specifying proper parameters to CoCreateInstance and that you are releasing the referrence count using Release() method after the first time creation of your component using CoCreateInstance .
@!$h@
|
|
|
|