|
The Problem is that i always get this error "Restricted data type attribute violation"
|
|
|
|
|
Check the datatypes you are using for the returned value.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
Why use ODBC? Ado simplifies life so much.
You'll need to supply more details of the actual error message as the SQL string looks fine.
Have you thought about using a stored procedure and ADO command object instead.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Hi,
I have developed an application where I want to display something in tree control using system font. I dont know how to get the system font and then how to display it in tree control..anyone has some idea..please do let me know.
Thanks in advance
|
|
|
|
|
Mmmh ...
I don't really understand what you mean by 'system font', but if you mean the current font in your control, there's several possibilities :
CWnd::GetFont will give you a handle to the font in the win. You can then use a CFont object, and assign it the font with CFont::FromHandle .
To get the font used in your tree control, add a member variable
CFont m_Font; .
Then if you have a CTreeCtrl, put it that way in your OnInitDialog() or whatever:
m_MyTreeCtrl.SetFont(m_Font);
Or, if you do only with the IDs,
CTreeCtrl* pTree = GetDlgItem ( IDC_TREE_LABEL );
pStatic->SetFont( &m_Font );
~RaGE();
|
|
|
|
|
Thanks for the reply. By 'System font' I mean to say is window's default font.
For example in browser when we type some url it displays that url in window's default font which we can change by right clicking on desktop settings.
Anyways thanks for the help.
|
|
|
|
|
I'm not sure to understand, however you may have a look to
GetStockObject[^], using as parameter DEFAULT_GUI_FONT.
HTH,
I hurt so bad inside
I wish you could see the world through my eyes
It stays the same
I just wanna laugh again
|
|
|
|
|
It worked... Thanks a lot.
|
|
|
|
|
Hi,
I have developed an mfc application and I want to run it as service...Is it possible? Please help me if anyone has some idea.
Thanks in advance
Deepesh
|
|
|
|
|
I reckon the easiest way is to start the ATL wizard, create a service, and move your code into it.
I dunno how hard it is to replumb an app as a service. I thought a service ideally had no GUI though.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thanks for the reply..but I am not able to understand what you are trying to say. I got one exe called Sc.Exe from microsoft which is used to make an application as service. When I used this I got the entry of the application in services but not able to start it gives error msg saying "Error 1053:The service did not respond to the start or control request in a timely fashion."
Do you have any idea why its happening?
|
|
|
|
|
Anonymous wrote:
Error 1053:The service did not respond to the start or control request in a timely fashion."
This usually means that your service hasn't been written properly i.e. it is not responding to commands that you give it from the service control panel e.g. stop and start.
I would really recomment that you get a skeleton service working first that does nothing more than log something to a file saying that it has started, stopped, etc., get that working and *then* transfer your real code into it.
You really need to be careful when transferring MFC code as well. Even if you do not do any UI stuff like show a dialog or message box, MFC still does some stuff behind the scenes that require you to be logged on. Check the MSDN.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
After being savagely “beaten” for posting this message in the Lounge, for which I’m sorry, here it goes again.
I’m performing a lengthy whenever the user logs off or shuts down. Currently I’m trapping WM_QUERYENDSESSION, and mimicking the request after the operation is finished.
This as the nasty effect of leaving some applications opened that could require the user intervention to save unsaved work as an example.
Is there another way to do this?
Thank you
Artur Jales Moreira
|
|
|
|
|
jales wrote:
This as the nasty effect of leaving some applications opened that could require the user intervention to save unsaved work as an example.
Normally, an application will respond to the WM_QUERYENDSESSION (or some WM_CLOSE related ) message and behave itself in a good manner. You should'nt have to do nothing about that; except if you trap the message and ditch it, so that no one else can receive it.
If you handle the WM_QUERYENDSESSION message in your application ( which I assume you are doing ), the OS should wait until your application is done before continuing with the shutdown/logoff process; It might show the "wait/cancel" dialog if the application is not responding for too long.
Max.
|
|
|
|
|
Maximilien wrote:
If you handle the WM_QUERYENDSESSION message in your application ( which I assume you are doing ), the OS should wait until your application is done before continuing with the shutdown/logoff process; It might show the "wait/cancel" dialog if the application is not responding for too long.
The reason that I'm not doing the work in the handler is to avoid that dialog from ever being shown. I also need to do a similar task on logon, and I solved that by registering the application in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. Isn't there a way to register an application to run on shutdown?
Thank you
Artur Jales Moreira
|
|
|
|
|
I'm glad you decided to post this after your savage beating.
From looking at the help on this message, it seems all you need to do is return something other than 0. Maybe your should allow other apps to handle this message while you continue to process.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
And doing the work in the handler for WM_ENDSESSION? Wouldn't that also show a System Dialog after a certain time, saying my application is not responding?
Artur Jales Moreira
|
|
|
|
|
jales wrote:
Wouldn't that also show a System Dialog after a certain time, saying my application is not responding?
Not if you do your operations in a seperate worker thread, and leave the UI thread open to talk to the system. If you're using MFC, it's as simple as AfxBeginThread()...
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
But if I respond to WM_ENDSESSION the application will end.
Artur Jales Moreira
|
|
|
|
|
I designed a small activex control with a Property page. The property page has a button control.
Suppose if a place this control on a Dialog Box by right clicking on the Control and selecting properties..., it displays the property page with button control. when i click a button the focus will change to ActiveX control window , where i can draw using mouse .
Any help ...
Thank you.
|
|
|
|
|
chepuri_uk wrote:
it displays the property page with button control. when i click a button the focus will change to ActiveX control window , where i can draw using mouse .
Any help ...
huh??? Are you asking how to do that just telling us you already do? Do you want to draw, like MS-Paint draw, or draw as in an owner-drawn menu?
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hi All...;P
i new in VC++...i have problem when i run the application in Release version...after a few click of button the application return a meesagebox
Application Error
The instruction at "0x6c3ce337" reference
memory at "0x0000003c". The memory could
not be "read"
Click on OK to terminate
Click on CANCEL to debug the program
When i click CANCEL another message box come ...it written unhandled eception MFC42 access violation...
but in the debug version is no problem....
how i want to overcome the problem....
regards
:_Rocket_:
|
|
|
|
|
There is an article here on CP about setting the project to build debug but think it's release.
Otherwise you can use messageboxes to figure out where you are crashing, or a log file.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
You may have a stray pointer there. Look at the memory address: 0x0000003c is certainly not a real variable adress.
You are having this error in Debug build also, but it is masked by some of the error-correction mechanisms there. Look for mentions of memory leaks when executing your Debug-build.
You are positively sure that every pointer you are using has been initialised and checked for validity before?
This can only be a starting point, but (as Christian said) there is an article about this on CP
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
If you cannot recreate in debug mode, perhaps you should throw in some message boxes to see exactly where the error is occurring. Once you narrow it down maybe you can figure out the problem.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|