|
Link[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
Hi,
I would like to build an win32 application which sould not inherit from explorer.exe. By default all MFC/Win 32 applications are loaded in explorer.exe. so any crash of application is causing crash to explorer and vice versa..
So i need to find out a way where my application wont be loaded in explorer.
Thanks in advance.
Birajendu
SonicWALL India.
Bangalore.
India
|
|
|
|
|
birajendu wrote: win32 application which sould not inherit from explorer.exe
I will tell you a trick, try to figure out where your application is crashing and why.
Fix the bug.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Obviosly i will do that. But that is not the only solution. It would be nice if we can luch programs with out inheriting from explorer.exe. I saw some apllication from some trusted venders used to do so.. they dont load their application on explorer.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: It would be nice if we can luch programs with out inheriting from explorer.exe
Well, that's the case. I have no clue about what you mean by "inheriting explorer"... If your application crashes, explorer doesn't crash. They are two independant things, so why would they interfere ? Unless maybe you are talking about something specific like a shell extension ?
|
|
|
|
|
yeah.. not exactly inheriting.. but all the applications in window by default load on explorer, some thing like child process of explorer. And my application is also doing the same. But i saw some applications like MacAfee client are independent.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: But i saw...
Using?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I want to create resizable propetysheet with watermark bitmap background.
Or a Header bitmap with colored background.
I am able to resize the proprtysheet but not header bitmap and background bitmap.
Please suggest some artical to do so.
|
|
|
|
|
CPropertySheet(
LPCTSTR pszCaption,
CWnd* pParentWnd,
UINT iSelectPage,
HBITMAP hbmWatermark,
HPALETTE hpalWatermark = NULL,
HBITMAP hbmHeader = NULL
);
See the parameters in bold. For setting the background you can override OnPaint message of your property sheet class
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I have resource DLLs for my application. I'm loading DLL in my application. I want to get text associated with all the IDs.Longer way I know but that is quite hectic and not a good programming style.
I just want to know the shortcut code for that which uses some APIs and loads the text.
Can anyone help me?
Thanks.......
|
|
|
|
|
Which method are you using to get id's from the resource dll?
LoadLibrary???
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
Hi Purish,
Have you tried SetDlgItemText[^] & GetDlgItemText[^]?
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
I am looking for the same.
Well how can I go there, I want to know the full code as I am new to it,so don't have much knowledge.
Something like AfxGetMainWnd-DlgCtrlId->
how can I do this?
Thanks..........
|
|
|
|
|
how to get those texts associated with IDs?
|
|
|
|
|
Purish Dwivedi wrote: Something like AfxGetMainWnd-DlgCtrlId->
If you are accessing Dialog item from DLL then DLL must have handle/pointer of CDialog class.
If you don't have then take one pointer of CDialog class & write one method in your DLL for setDialog(CDailog*)
So, at initialization of DLL you can specify CDialog pointer in that.
I hope this works for you.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
Are you referring to LoadString() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi i am using CEDB to access windows CE datas.. Now i need to update the datas in CEDB.
code:
oid=CeSeekDatabaseEx(globalHDB,CEDB_SEEK_BEGINNING,seekcount,NULL,NULL);
I use it to seek in database for each cases i uses
case 0:
epropColumn[0].propid = CID_BOOKID;
cepropColumn[0].val.lpwstr=szBookID;
cepropColumn[0].wFlags = NULL;
cepropColumn[0].wLenData = 0;
to get the column values i use these cases for each column of the row.
Can any one help me to change only one value in the row.
for example
if i hav book id,book_name,author.
say
bk001,C++,martin
i need it to be changed as
bk001,Java,martin
A code snippet would be help ful.
Help me to trace it out.
Thanks in Advance.
|
|
|
|
|
I am writing the simple copy files console.
And i am getting the error:
error C2664: 'CreateFileA' : cannot convert parameter 1 from 'std::basic_string<elem,_traits,_ax>' to 'LPCSTR'
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
const int BUF_SIZE = 1024;
int main(int argc, char *argv[])
{
HANDLE fileIn, fileOut;
char buf[BUF_SIZE];
DWORD nread,nwrote;
string folder1 = "C:\\firstFolder\\";
string folder2 = "C:\\secondFolder\\";
string folder[] = {folder1, folder2};
int count=0;
for (int i = 0; i < 2; i++)
{
// copy files
if ((fileIn = CreateFile("1.doc", GENERIC_READ,0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening source: " << GetLastError() << endl;
}
if ((fileOut = CreateFile(folder[i] + "new.doc", GENERIC_WRITE,0, 0, CREATE_NEW, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening destination: " << GetLastError() << endl;
}
while (ReadFile(fileIn, buf, BUF_SIZE,&nread, NULL) && nread > 0) {
if ( ! WriteFile(fileOut, buf, nread,&nwrote, NULL)) {
cerr << "Error copy" << GetLastError() << endl;
}
}
CloseHandle(fileIn);
CloseHandle(fileOut);
// copy files
if ((fileIn = CreateFile("2.doc", GENERIC_READ,0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening source: " << GetLastError() << endl;
}
if ((fileOut = CreateFile(folder[i] + "new2.doc", GENERIC_WRITE,0, 0, CREATE_NEW, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening destination: " << GetLastError() << endl;
}
while (ReadFile(fileIn, buf, BUF_SIZE,&nread, NULL) && nread > 0) {
if ( ! WriteFile(fileOut, buf, nread,&nwrote, NULL)) {
cerr << "Error copy" << GetLastError() << endl;
}
}
CloseHandle(fileIn);
CloseHandle(fileOut);
}
return 0;
}
Does any one know how to solve the error?
Pls show me a example code if possible, thanks.
|
|
|
|
|
you can do it like this
CreateFile(_T("1.doc"), GENERIC_READ,0, 0, OPEN_EXISTING, 0, 0)
|
|
|
|
|
This line of code doesn't has error,
CreateFile("1.doc", GENERIC_READ,0, 0, OPEN_EXISTING, 0, 0)
My error code is here,
fileOut = CreateFile(folder[i] + "new.doc", GENERIC_WRITE,0, 0, CREATE_NEW, 0, 0)
I cannot write the string into the parameter 1 with only allow 'LPCSTR', and i tried to convert it, but i getting another error:
CXX0052: Error: member function not present
string path;
path = folder[i] + "new.doc";
fileOut = CreateFile(path.c_str(),GENERIC_WRITE,0, 0, CREATE_NEW, 0, 0);
any idea? thanks..
|
|
|
|
|
// test01.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
const int BUF_SIZE = 1024;
int main(int argc, char *argv[])
{
HANDLE fileIn, fileOut;
char buf[BUF_SIZE];
DWORD nread,nwrote;
wstring folder1 = L"C:\\firstFolder\\";
wstring folder2 = L"C:\\secondFolder\\";
wstring file1 =L"1.doc";
wstring file2=L"new.doc";
wstring file3=L"2.doc";
wstring file4=L"new2.doc";
wstring folder[] = {folder1, folder2};
int count=0;
for (int i = 0; i < 2; i++)
{
// copy files
if ((fileIn = CreateFile(file1.c_str(), GENERIC_READ,0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening source: " << GetLastError() << endl;
}
if ((fileOut = CreateFile((folder[i] + file2).c_str(), GENERIC_WRITE,0, 0, CREATE_NEW, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening destination: " << GetLastError() << endl;
}
while (ReadFile(fileIn, buf, BUF_SIZE,&nread, NULL) && nread > 0) {
if ( ! WriteFile(fileOut, buf, nread,&nwrote, NULL)) {
cerr << "Error copy" << GetLastError() << endl;
}
}
CloseHandle(fileIn);
CloseHandle(fileOut);
// copy files
if ((fileIn = CreateFile(file3.c_str(), GENERIC_READ,0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening source: " << GetLastError() << endl;
}
if ((fileOut = CreateFile((folder[i] + file4).c_str(), GENERIC_WRITE,0, 0, CREATE_NEW, 0, 0)) == INVALID_HANDLE_VALUE) {
cerr << "Error opening destination: " << GetLastError() << endl;
}
while (ReadFile(fileIn, buf, BUF_SIZE,&nread, NULL) && nread > 0) {
if ( ! WriteFile(fileOut, buf, nread,&nwrote, NULL)) {
cerr << "Error copy" << GetLastError() << endl;
}
}
CloseHandle(fileIn);
CloseHandle(fileOut);
}
return 0;
}
|
|
|
|
|
You are misusing the string class. Read the docs
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: You are misusing the string class. Read the docs
Ah, but string deserves it. It said bad things about his mother.
But I'm not a huge fan of string for this reason. I quite like CString's implicit LPCTSTR conversion.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|