|
Okay,
I've written my application in mfc c++, but what has that to do with my setup project? I jsut need an answer for the development projects, not for mfc!
|
|
|
|
|
BoudewijnEctor wrote:
I've written my application in mfc c++...
Yet here you indicate otherwise. I initially provided you an answer for both VC++ and MFC. One of them will apply.
BoudewijnEctor wrote:
I jsut need an answer for the development projects, not for mfc!
The fact that you are writing a setup project (it could be a game, an accounting package, a printer driver, etc) is irrelevant. You wanted to know how to "evaluate the value" of a checkbox and I provided you with two options. If those answers are not right for your situation, perhaps you should rethink your initial question.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
what setup ? there are tons of them ...
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
My program is setting the default printer to Distiller which is then receiving the print job and writing PDF's to the specified location i.e. Distillers Port.
On some Windows 2000 PC's we are unable to set the Distiller Port, so I was wondering whether it is possible to reset the Distiller Port in code, on Windows 2000.
I am setting the Default Printer to Distiller with SetDefaultPrinter( ... ) and then issuing a Windows Broadcast message to all apps. For NT4 I am using WriteProfileString( ... ) and then issung a Broadcast message.
I would appreciate any help, or advise from anyone who has had a similar issue with Distiller and not being able to Add a PDF Port to a Windows 2000 PC.
|
|
|
|
|
Hi everyone,
I wasn't sure if this is a COM issue or MFC issue, so I also posted this question in the COM message board...
I have an MFC app (with a CWinApp-derived object) that uses COM objects (Crystal Reports). The COM library is imported into my project via the #import directive. I'm using VStudio 6.0 sp5.
I've created a global object called _com_init:
struct ComInit {
ComInit() { ::CoInitialize(NULL); }
~ComInit() { ::CoUninitialize(); }
} _com_init_;
This way, I guarantee that COM will initialize before the _main() and terminate after the _main().
When my program reaches ~ComInit() and calls ::CoUninitialize(), I see the following message in my Debug Output Window:
First-chance exception in MyApp.exe (OLE32.DLL): 0xC0000005: Access Violation.
Any ideas? I've looked up other CoUninitialize threads in these forums, but couldn't figure out something that would solve my problem...
Thanks.
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
The most important aspect of using COM with MFC is to initialize and uninitialize COM correctly.
Instead of using a global object, I suggest that you put ::CoInitialize(NULL) in the start of your CWinApp-derived application's 'InitInstance' and ::CoUninitialize() o the end of the same application's 'ExitInstance' (Before return call). This way, the initialization and uninitialization are handled smoothly.
As for the actual problem, I have just about no idea of where it lies. I suggest using the above methodology to utilize COM server.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I already tried that. It was a lot worse when I did that. The result was about a zillion "Access Violation" messages instead of just one. I think there was also a "Stack overflow" message somewhere among them...
Also, it may have been unclear earlier, but the program doesn't abort with an Access Violation MESSAGE BOX. I only see the message in the debug output window. If I try what you suggested, I also get an Access Violation message box...
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
Have you determined that the COM server is indeed initialized?
if(::CoInitialize()!=S_OK)
MessageBox(_T("COM INIT FAILED"),NULL,MB_ICONERROR);
??
|
|
|
|
|
Yes, I have. I get S_OK.
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
HI.
I am starting out on Winsock stuff. I have been lookin gat the articles. For using any Winsock type commands, I need the Platform SDK? Is there an way without the Platform SDK? I was looking at how to down load this, do I only need the CORE SDK?
Thanks.
|
|
|
|
|
For winsock stuff, you dont need anything other than what you get in VisualStudio.
|
|
|
|
|
Like johnny said - use what you get in VS.
Easiest and most preferred for beginners is to create a class derived from CAsyncSocket - and override SetParent function. I've tried other methods which are more in-depth, but still find this one the easiest and most straight-forward. Don't forget AfxSocketInit().
I did not write W32.Blaster quit asking.
|
|
|
|
|
I have the following code where I am readin the file. Each line ends by '~'. I was able to get the first line, but I could not get the 2,3... lines.Can't see where my error is
do
{ string line;
getline(f,line,'~');
if (f.eof()) break;
getline(f,dump);
cout << line << endl;
count++;
} while (true);
|
|
|
|
|
If the while loop is terminating (prematurely), the if (f.eof()) condition must be evaluating to TRUE. Can you confirm or deny?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hi im aswin,
i need help recording CSocket. i want to know the difference between csocket and CAsyncSocket and which is the best to use.
1) When i use CSocket if one application acts as a server and other as client if the client disconnect abruptly how do i know that.
2) How do i make sure client has received correct datat the server has sen.
3) how do i send file using CSocket which may be more then 1 MB.
4) how do i make sure that a port isnt used by any other application.
5) Consider i use create command with port 1102. but when i use getport method i see that it shows different port.
plz help me in this situation as this is my first day in a company after graduating this april.
Regards
Aswin.N.Paranji
India
|
|
|
|
|
1) I have never used CSocket, but I would suggest that CAsyncSocket provides what you need here and will be easier to use - just override the OnClose function, set the AsyncSelect flags, and you will be notified when the remote client disconnects.
2) You dont need to do anything. TCP/IP ensures that the data is correct.
3) Just send it, theres nothing special you need to do because its 1MB.
4) Try and open the port. If it fails look at the error code and see if it indicates the port is in use. If you want to know beforehand then you can try and connect to the port and expect a failure - a success means the port is open.
5) I cannot see a getport function within CSocket or CAsyncSocket - what are you using to obtain the information? If you create a socket on a port then, provided its not in use, thats the port that will be used.
|
|
|
|
|
sorry i use getpeername function within casyncsocket.
i would be happy if you can explain me what is blocking.
|
|
|
|
|
Hi:
In ClistCtrl,I want to change the icon of some item.And I try :
m_ctrlListDevice.SetItem(nItem,0,0,NULL,1,0,0,0);
but nothing happen.The icon isn't changed. Why? How could I do to change the icon?
Thanks
Benben
|
|
|
|
|
Shouldn't it be:
m_ctrlListDevice.SetItem(nItem, 0, LVIF_IMAGE, "", 1, 0, 0, 0); This assumes, of course, that m_ctrlListDevice.SetImageList() has been previously called and that at least two images exist in the list.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks.MSDN doesn't tell me this clearly.
Thanks
Benben
|
|
|
|
|
hi all,
whats the major difference between a Service and a Exe
|
|
|
|
|
Service is in fact an exe that is running under the Service Control Manager (SCM) context = do not need some user to start it interactivelly. It's called daemon at uni*es.
|
|
|
|
|
hi Everybody
my problem regarding insert section and key name in ini file using map.i have done all this by using vector
but i want to it compatible with map.i have used two structure given belowusing vector
// st_key
// This structure stores the definition of a key. A key is a named identifier
// that is associated with a value. It may or may not have a comment. All comments
// must PRECEDE the key on the line in the config file.
typedef struct st_key
{
t_Str szKey;
t_Str szValue;
t_Str szComment;
st_key()
{
szKey = t_Str("");
szValue = t_Str("");
szComment = t_Str("");
}
} t_Key;
typedef std::vector<t_key> KeyList;
typedef KeyList::iterator KeyItor;
// st_section
// This structure stores the definition of a section. A section contains any number
// of keys (see st_keys), and may or may not have a comment. Like keys, all
// comments must precede the section.
typedef struct st_section
{
t_Str szName;
t_Str szComment;
KeyList Keys;
st_section()
{
szName = t_Str("");
szComment = t_Str("");
Keys.clear();
}
} t_Section;
typedef std::vector<t_section> SectionList;
typedef SectionList::iterator SectionItor;
/// General Purpose Utility Functions ///////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
void Report(e_DebugLevel DebugLevel, char *fmt, ...);
t_Str GetNextWord(t_Str& CommandLine);
int CompareNoCase(t_Str str1, t_Str str2);
void Trim(t_Str& szStr);
int WriteLn(fstream& stream, char* fmt, ...);
fefgfgfgfgfg
|
|
|
|
|
Dear Friends ,
I am creating a toolband for IE and i need to change the text on the timer tick after a interval of 10 seconds.I tried doing it using
TBBUTTONINFO but it seems nothing is happening.Here is the code for that.
void CKBToolBarCtrl::OnTimer(UINT ID)
{
char str[10]="test";
LPSTR pszBuf=str;
TBBUTTONINFO tbi;
tbi.dwMask = TBIF_TEXT;
tbi.cbSize = sizeof (TBBUTTONINFO);
tbi.pszText = (unsigned short *)pszBuf;
tbi.cchText = sizeof (pokerstr);
CToolBarCtrl::SetButtonInfo(ID_BUTTON1, &tbi);
}
one more problem i am facing when i try to assign pszBuf to tbi.pszText without casting it gives me error unable to convert from char* to unsigned short* , however when i write the same code for simple MFC application everything works fine.
Any help will be heartly appreciated.
|
|
|
|
|
HI,
I have a MFC DLL project.This created DLL sits in the third party exe.
One of the statement in the DLL code:
************************************************************************************
STRING str = STRING(GetModuleHandle("X.dll"), 0x409, STR_PROGRAMD);
where
// MessageId: STR_PROGRAMD
// MessageText:
// UMDC_PROGRAMD%0
#define STR_PROGRAMD ((DWORD)0x00001006L) in msgtable.h file
************************************************************************************
but the the variable str is returning "FormatMessage() failed for 100001006"
Getlasterror() returns "1813- The specified resource type cannot be found in the image file"
Pls help what could be the problem??
Thnks in advance
|
|
|
|