|
Dear All:
I use MFC's Wizard to generate a MDI application with a Full-server support. It passed the link pretty good but when I F5, an Assert problem occurs! The message looks like this:
Debug Assertion Failed!
File: olelink.cpp
Line:291
This assert is invoked by following codes in InitInstance and after AddDocTemplate();
//Connect the COleTemplateServer to the documenttemplate.
//The COleTemplateServer creates new documents on behalf
//of requesting OLE containers by using information
//specified in the document template.
m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
// Register all OLE server factories as running.
// This enables the OLE libraries to create objects from
// other applications.
COleTemplateServer::RegisterAll();
The same code works on other people's machine pretty good, but some other people have the same problem.
Has anybody meet this problem before?
Thanks a lot.
|
|
|
|
|
How can I select the text in a CEdit control.
I have tried the SetSel(first_pos, last_pos) but the text don't be "blue".
SetSel() works fine to cut or paste... but i want the text to be marked whit the blue line, as when using mouse.
regards,
Ola
|
|
|
|
|
After the SetSel you need to do a SetFocus
m_pedit.SetSel(1,10);
m_pedit.SetFocus();
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
hmm...
I still can't get the text marked blue.
/Ola
|
|
|
|
|
Then what color are they coming in?
Or are you saying text is not even selected?
And does the cursor start blinking in the edit box?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Text in edit box is not visible selected.
Cursor starts blinking, and if I use m_editbox1.Cut(); text disappear.
If I write some, text in edit box are not replaced.
Code example:
void CMyClass::OnSetfocusBox1()
{
m_box1.SetSel(1,10);
m_box1.SetFocus();
// m_box1.Cut(); works, but text in box are never visable selected.
}
Ola
|
|
|
|
|
I am writing a EBCDIC conversion program but this is all new to me. Is there a function that allows you to take in more than a byte at a time and convert it, for example.
My second and third bytes (0x00 0x08) indicate the length of the record. Therefore I don't want to take them in one at a time I want both bytes and then convert them to give me a length.
Any tips on such a thing would be appreciated?
|
|
|
|
|
I know nothing of EBCDIC, but of course you can do anything you want with single bytes!
if you have two bytes, 0x00 and 0x08, which together represent a length, then:
BYTE h,l;
DWORD combined=0;
h=0x00; l=0x08;
combined= (h << 8) + l;
the << (and the >>) operaters shift bits left and right respectively.
The line of code I wrote will generate warnings about differering types of lvalue and rvalue, you can shut this up with some explicit casting.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hello,
I am trying to run a sample program using simpleMapi to send an email.But I get this error
"The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was 'archanamahapatra@hotmail.com'. Subject 'Demo email using CMapiSession - Please ignore', Account: 'pddmail1', Server: 'pddmail1', Protocol: SMTP, Server Response: '550 5.7.1 Unable to relay for archanamahapatra@hotmail.com', Port: 25, Secure(SSL): No, Server Error: 550, Error Number: 0x800CCC79"
I have Microsoft Outlook on my machine.
Archana
|
|
|
|
|
The SMTP server you are connecting to has rejected your send mail action.
I am not familiar with the 'simpleMapi' code you are running, but I can tell you that the official explanation of SMTP Error 550 is:
"Requested Action Not Taken: Mailbox unavailable, e.g. mailbox not found"
Hope this helps,
Robert
|
|
|
|
|
All,
What is the simplest way to pop-up a scrollable help screen that presents help instructions from a text file?
I know how to pop a new Dialog, and can place an Edit box, etc. in there but:
- I don't know how to make that Dialog 'not attached' to the parent Dialog so the user can continue interacting with the parent and ocassionally scroll the help dialog.
- Is there a simpler way to do it than I have mentioned?
Much thanks,
Robert
|
|
|
|
|
Robert Palma Jr. wrote:
- I don't know how to make that Dialog 'not attached' to the parent Dialog so the user can continue interacting with the parent and ocassionally scroll the help dialog.
Make it a child of the desktop.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks for reply Christian,
Afraid I'm not sure how to do that.
I tried setting the property of the new Dialog to 'Child' rather than 'Popup', but that seemed to cause the new Dialog to paint on top of the parent Dialog in a semi-transparent way and I lost all control of either Dialog.
Robert
|
|
|
|
|
A style of Child means your dialog is embedded in another window, i.e. has no frame of it's own and moves when the parent is moved. A button or listbox is an example of a WS_CHILD window.
When you create a dialog, you optionally pass in a pointer to the parent, so normally creating a dialog should look like this:
CMyDialog dlg(this);
Instead, do this:
CMyDialog dlg(GetDesktopWindow());
and the parent will be the desktop. In theory they will have the same parent now and thus can be on top of each other equally.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thanks again Christian,
I am unable to locate any code as you have shown.
My main dialog Class: CTest2Dlg
My help pop up Class: CHelpx
When I call the Help Dialog with a button press, I call:
m_hdlg.DoModal();
In Test2Dlg.h I include the following:
#include "Helpx.h"
CHelpx m_hdlg;
The last line above seems to be close to the code you posted, but it does not accept any parameter, i.e. it will not take:
CHelpx m_hdlg(this);
Sorry I'm so slow on this. I'm an old C dinasour.
Thanks again,
Robert
|
|
|
|
|
If the dialog is a member variable, you'll need to either make it a pointer and call new/delete on it, or initialise it before the constructor, i.e. like this:
CTest2Dlg::CTest2Dlg() : m_hdlg(GetDesktopWindow)
{
// Constructor.
}
Why does it need to be a member ? you should create it when you need it, there's no reason for it to sit there the rest of the time.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi Christian,
Thanks for recent reply
Previously my Test2Dlg.h contained:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog,
{
// Construction
public:
I then changed it to:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog,
CTest2Dlg::CTest2Dlg() : m_hdlg(GetDesktopWindow)
{
// Construction
public:
I get the errors referenced to the line I added:
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
test2Dlg.cpp
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
Error 2059 seems to be a simple format/syntax error... can you tell me ??
Much thanks for your generous help,
Robert
|
|
|
|
|
Opps I put a typo in the 'Original' Code, an extra comma!
Corrected is below:
Previously my Test2Dlg.h contained:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog
{
// Construction
public:
I then changed it to:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog,
CTest2Dlg::CTest2Dlg() : m_hdlg(GetDesktopWindow)
{
// Construction
public:
I get the errors referenced to the line I added:
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
test2Dlg.cpp
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
Error 2059 seems to be a simple format/syntax error... can you tell me ??
Much thanks for your generous help,
Robert
|
|
|
|
|
I think, as I said before, that you should not have this dialog as a member variable. The only reason to make it a member is if you want it to be modeless.
I have never tried to create a dialog as you are above, so I could be wrong in thinking the : syntax will work this way.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Have you looked at WinHelp or HTML Help?
|
|
|
|
|
how can i send a file from a client to a server and the other way around if i have a tcp connection between these two and the socket uses CAsyncSocket????
i can establish a connection and i can send text and stuff.
if i'd get the handle to a file and store the data in a BYTE maybe i could just use Send() on that BYTE or not?? what happens if its too big, dus the winsock divide it automatically or do i have to segment the BYTE??
Some help please
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
You cannot rely on CAsyncSocket::Send sending as much data as you provide it on a single call all at once. Please note that instead the function returns how many bytes it managed to swallow. Then you have to wait to the next invokation to your OnSend function, stuff the remaining bytes to the socket, and so on.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, All!!!
=======
Back in MS-Dos era to create a sound using the PC speaker we used sound() .
Is there anything like this in MS Windows 2000 ?
1 more thing:
* Can any of you guys throw me a bone about sound Inout and Output.
Thanks
P.S
* What is RIFF, PCM or something like that ?
Sagiv
|
|
|
|
|
i found that about the PCM :
Wav files can have a range of sample rates and different sample types. Without going into the technical detail, PCM is the purest audio format, and offers much better sound quality than other compressed formats such as ADPCM or Real Audio. The downside is that file sizes are large. A high sample rate provides better quality audio but has a much larger file size. Similarly, 16 bit PCM gives less hiss but has a file size double that of 8 bit PCM. As a general rule, you will not viably be able to embed an autostart file which is longer than 10 seconds. To have longer recordings you will need to use Real Audio or mp3 (see below).
have a look there for more details : http://www.world-voices.com/resources/addaud.html
Fred
|
|
|
|
|
Beep() to make a sound, PlaySound() to play a wave, and DirectSound to get the whole input/output thing happening nicely. I believe there is a CP article on recording sound not using DX, but I'm not familiar with how it is done.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|