|
Hi,
I have one MFC application some times it gives me error message "A Required resource was" and I have to close application
from taskbar.
Can ayn one tell me what is that and how to ovecome it.
Thanks in advance,
Rushiraj
|
|
|
|
|
rushiraj.jhala wrote: "A Required resource was"
Is this complete error message , you are talking about ?
|
|
|
|
|
Yes,
This is all what I got on messagebox.
thanks,
Rushiraj
|
|
|
|
|
hello,
I created a win32 project(precompiled headers, console application). This was created to create a service( for which i used SERVICE_TABLE_ENTRY, SERVICE_STATUS, SERVICE_STATUS_HANDLE, etc... required structures and methods).
Environment used:
Windows XP, VC++.Net2005.
Should work on:
I want to make this exe to run on windows 95,98, XP, 2000 and Vista.
my stdafx.h file contains:
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
#pragma warning (disable:4430)//... i added this, since i was getting this error. and in msdn this //was given as its solution.
To this project, i have added two more files:
1) USBActivity.h
2) USBActivity.cpp
In USBActivity.cpp the hierarchy of headers included is as follows:
#include "stdafx.h"
#include <initguid.h>
#include "stdio.h"
#include <setupapi.h>
#include <dbt.h>
#include "afxcmn.h"
#include "cfgmgr32.h"
#include "Blowfish_Data_FileEncrpt.h"
#include "USBActivity.h"
The project properties are set as: Use windows Standard libraries, WIN32;_DEBUG;_CONSOLE as preprocessor definitions, Basic Run-TimeChks: Both (/RTC1, equiv. to /RTCsu) , RunTime-Library --> Multi-threaded Debug (/MTd), Use Precompiled Header (/Yu), Linker+AdditionalDependencies-->setupapi.lib.
I am getting following build errors:
Compiling...
stdafx.cpp
Compiling...
Blowfish_Data_FileEncrpt.cpp
DataSentinelService.cpp
d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation
DoubleBuffering.cpp
SHA.cpp
USBActivity.cpp
d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
DataSentinelService - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I guess the error is because of :
--> calling a function in an SDK header file that is currently not supported in current build environment.
Could anybody help me out... in fixing this problem.
I have also seen the project given at the following link: http://www.codeproject.com/system/RemoveDriveByLetter.asp?df=100&forumid=294340&exp=0&select=1822184&tid=1815457#xx1822184xx
Here, it is given in vc++ 6. and when i compared the build environment everything was same.
In order to enumerate enumerate all the USB devices connected to PC, using a windows service... i have to use setupAPI in order to get setupDiGetDevClass etc methods.
I also tried with including windows.h file in stdafx.h. but it was also not helpful. since was included by-default. And on including it again i am getting the following error:
d:\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
Is there any other alternative?
Thanks
Anee
Anee
|
|
|
|
|
anumadhu wrote: #pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include
#include
Choose, ignore html tags option, so that file included will be visible. Modify your post for that.
I feel its causing because of incorrect sequence of include headers.
|
|
|
|
|
yeah, probing towards the cause of this problem, i got two causes:
1) What you said that, the wrong order of include headers.
2) Accessing the SDK files from a application(my application) which does not support current build environment.
I am using VC++.Net2005 and Windows XP. I have tried lot many options of including the order of headers.. but none of them was much helpful.
And coming to not supporting build environment, i don understand how to get into its solution.
Do you have any clue or idea.
Thanks
Anee
Anee
|
|
|
|
|
Can anyone suggest me how to retrieve the offset value from an EXE file ...
|
|
|
|
|
wrote: the offset value from an EXE file
what's that ?
|
|
|
|
|
What offset are you talking about?
Offsets of different sections in the PE format? You have to read the PE header (and knowing the PE format helps).
Default address/offset of loading into memory?
Offset of where the good code ends and the bad code begins?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: Offset of where the...bad code begins?
Isn't this always at offset 0?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi
can anybody tell me any algoirthm to convert WAVE audio format to MP3.
thanks in advance
|
|
|
|
|
|
You don't need a library (you can write your own) if you know the WAV file format and the MP3
format/compression. Google may help
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Well I have almost done the remove item from the list but the problem is that one item is rest each time in the listview when I clicked to “clearcomplete”.
In detail,
I add my files from the add button and select that file and proceed to protect, before protection the file shown the status “incomplete” but when the file protected
I had change the status to “complete” in the particular column. When a bundle of “complete” files seen in the list the user can remove it from the listview for that I have write the code
On WM_COMMAND providing one for loop , iterate up to count in each count checking out whether the column having “complete” then remove it, but when I fetch the status it shown me each time “complete” incase of when counter(i) contain the status “incomplete”.
Please check the code is it ok ?
case IDC_CLR_COMPLETED:
{
if(lParam==-1)
{
EnableWindow(hDlg,FALSE);
}
else
{
int count=ListView_GetItemCount(hList);
TCHAR buff[MAX_PATH]={0};
for(int i=0;i<count;i++)
{
ListView_GetItemText(hList,i,9,(LPWSTR)&buff,MAX_PATH);
std::wstring buff_input(buff);
std::string compare(buff_input.begin(),buff_input.end());
if(compare=="complete")
{
ListView_DeleteItem(hList,i);
}
}
}
}
break;
2) how can I call Wndproc again once I logout? Do I need to make any service for that? In my application there is login/logout funda.
Help ! me please!
Thanks & regards
Amit
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: for(int i=0;i
First of all change your for loop logic, just reverse the loop like
for (int nIndex = nItemCount; nIndex >= 0; nIdex--)
This will solve one logical problem.
amitmistry_petlad wrote: if(compare=="complete")
Instead of checking like this, use any of the string comparing API..
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanks appu!
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Parthi_Appu wrote: int nIndex = nItemCount;
Correction, Should be int nIndex = (nItemCount-1) .
|
|
|
|
|
prasad_som wrote: int nIndex = (nItemCount-1).
Do your Duty and Don't expect the Result
|
|
|
|
|
Parthi_Appu wrote: amitmistry_petlad wrote:
if(compare=="complete")
Instead of checking like this, use any of the string comparing API..
The operator== is part of std::string . Why would you suggest using some other function?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Why would you suggest using some other function?
Confussed with Java
-- modified at 1:40 Friday 23rd March, 2007
Is that std::string has operator == overloaded?
Refer http://msdn2.microsoft.com/en-us/library/5zz6weyz(VS.80).aspx[^]
Do your Duty and Don't expect the Result
Rate this Post, if I helped You
|
|
|
|
|
Parthi_Appu wrote: Is that std::string has operator == overloaded?
operator==
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hey Thanx.
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
amitmistry_petlad wrote: int count=ListView_GetItemCount(hList); TCHAR buff[MAX_PATH]={0}; for(int i=0;i { ListView_GetItemText(hList,i,9,(LPWSTR)&buff,MAX_PATH);// I found the fault here might be the buff not cleared every time so its display “complete” every time incase of when item having “incomplet”. std::wstring buff_input(buff); std::string compare(buff_input.begin(),buff_input.end()); if(compare=="complete") { ListView_DeleteItem(hList,i); } }
I'm seeing immediate problem in above code. You are getting item count from list box. And used it in for loop for deleting items.
But with each deletion, this count should be decreased, where as you are refering to same old count .
amitmistry_petlad wrote: 2) how can I call Wndproc again once I logout? Do I need to make any service for that? In my application there is login/logout funda.
Help ! me please!
Yes, you need to write windows service for this. You would get lots of good articles on CP for this.
|
|
|
|
|
Thanks prasad
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
I added one edit control in my dialog. I restricted to number only. It is a normal edit box. In properties I made it to number only. In normal key press event user can not enter other than numbers. But when i given to tester, he is trying to copying the data from else where and pasteing in this edit box. Any simple way to restrict this copy and paste one. (Other than creating our own deriving CCustomEdit). any clues friends...
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|