|
There is no built in way even for the 24 bits image???
|
|
|
|
|
For any non paletised image it's easy, if you really want to. Just define a struct and read those structs from your byte array. The built in way is get/set pixel, but it's plainly obvious that any built in way would suffer from the problems this method suffer from. As soon as you add a wrapper to the underlying code, which must turn the image into a byte array, read the bytes and figure out the values from there, you slow things down.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hello,
i want to make program ras api completely,
i mean, i'll make the dial up(DUN) and the response for the dial up
for the the dial up is not my problem.
the problem is how to handle incoming connection using ras api?
i want to call incoming connection dialog in the windows programmatically with visual C++ and i don't know.
i am using window 2000
please help me, if anyone knows to handle this.....
|
|
|
|
|
I am also facing the same problem. If you could help me in creating an incoming connection to recieve the messages, it would very nice of you.
Thanks let me know if you find any solution.
|
|
|
|
|
Writing Plug In For MS Outlook
Using C/C++ VisStu 6.0
I am looking for any references, books, code, examples, tutorials for writing a Plug In for MS Outlook.
My Plug In will be an encrytpion module for Outlook email.
Many thanks,
Robert
|
|
|
|
|
<br />
void CEffectsDlg::OnCustomdrawSlider2(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
if(delayOn)<br />
{<br />
m_sl2Val.Format("Val: %d%%", (sl2Max - m_sl2Ctrl.GetPos()));<br />
<br />
UpdateData(FALSE);<br />
}<br />
<br />
*pResult = 0;<br />
}<br />
My problem is that the above code appears to be called before I get a chance to assign delayOn a value (its called immediately when the program is launched). I verified this by sticking a MessageBox in with the above.
A setup() function in OnInitDialog() should stop this from happening by declaring delayOn to be FALSE, but this is obviously being called after OnCustomdrawSlider2.
Is there any way round this?
Cheers.
|
|
|
|
|
Set delayOn to FALSE in the dialog's constructor.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Just as a side comment:
I doubt calling UpdateData() is a good idea in a custom draw routine. If the UpdateData() call changes the value associated with the control and causes the control to be redrawn, you could end up infinitely recursing.
Software Zen: delete this;
|
|
|
|
|
I am interested if someone knows a method to PAUSE a process to freeze it. Not freezing all of it's threads . . . but the process
Thank you!!!
gabby
|
|
|
|
|
It sounds like you're thinking there is a separate 'process thread of execution' that is somehow different or separate from other threads. That is not the case. A Windows process is a collection of one or more threads, executing within a context. In order to 'pause' a process, you would have to suspend all of its threads. This would essentially stop the process from consuming CPU time resources.
What problem are you trying to solve by 'pausing' a process?
Software Zen: delete this;
|
|
|
|
|
Gary R. Wheeler wrote:
What problem are you trying to solve by 'pausing' a process?
Or create.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
That thought did occur to me.
Software Zen: delete this;
|
|
|
|
|
I just wanted toi know if there is any possible way of pausing a process other than pausing all it's threads.
Thank you.
|
|
|
|
|
I need to access / operate on selected document/view. I iterate thru the template / document / view using the well documented process (code snippet follows).
I do not understand why the debug shows returned pointers to the derived class when the API variables are assigned to "base" class as follows:
CDocTemplate *pDocTemplate;
CDocument *pDocument;
CView *pView;
The debug shows derived class name but only the base class functions and variables.
My question is - how do I get to the derived class?
"Standard " iteration:
POSITION positionTemplate = GetFirstDocTemplatePosition();
while(positionTemplate)
{
pDocTemplate = GetNextDocTemplate(positionTemplate);
POSITION positionDoc = pDocTemplate->GetFirstDocPosition();
while(positionDoc)
{
pDocument = pDocTemplate->GetNextDoc(positionDoc);
POSITION positionView = pDocument->GetFirstViewPosition();
while (positionView)
{
pView = pDocument->GetNextView(positionView);
etc.
Thanks for your help.
Vaclav
|
|
|
|
|
Your document class is derived from CDocument, so you can do a direct comparison of the pDocument pointer and the address of your document.
if (pDocument == &MyDocument) You can do the same with the pView and your view.
If you do not have the address of your document and view, and just want to check if the returned pDocument or pView are of the same type as yours, then you can do a dynamic_cast of the pointer. The cast will return NULL if the pointer does not point to an object of your type
CMyView *pMyView = dynamic_cast<CMyView *>(pView);
if (pMyView == NULL)
else
[edit]fixed the < and > characters[/edit]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you, your suggestion basically works.
However if used directy, per MSDN, in the syntax you suggested
CCCImageView *imageView = dynamic_cast <cccimageview*> (pView);
I get "Unhandled Exception....
When I use DYNAMIC_DOWNCAST macro in the following syntax
CCCImageView *imageView = DYNAMIC_DOWNCAST(CCCImageView, pView);
it does exactly what I need to accomplish.
What is really strange - the "dynamic_cast" in MSDN ( January 2001) has reasonable explanation what it does, but the macro is documented rather poorly.
Thanks again
Vaclav
|
|
|
|
|
MSDN[^] does state that the dynamic_cast operator can throw exceptions in two instances:<lu>You are trying to cast a reference (not a pointer) and the cast failed.The typeid of the pointer or reference can not be determined.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Does anyone know the easiest way to ensure that a string of a folder path does indeed refer to a real folder in C++/MFC?
Joel Holdsworth
|
|
|
|
|
GetFileAttributes(szPath) != (DWORD)-1
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I like this method. Although I think it should be:
GetFileAttribute(szPath) == FILE_ATTRIBUTE_DIRECTORY Thanks for the hint!
Joel Holdsworth
|
|
|
|
|
You are correct about the FILE_ATTRIBUTE_DIRECTORY bit. But you had better use the bitwise and (&) operator, do not check for equality, as a directory can be hidden, readonly, etc.
DWORD attrib = GetFileAttributes(szPath);
if (attrib != (DWORD)-1 && attrib & FILE_ATTRIBUTE_DIRECTORY)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Yeah I picked up on that, just after I wrote the post!
Joel Holdsworth
|
|
|
|
|
CFileFind, use IsDirectory()
|
|
|
|
|
bool dirExists
(CString strDirectory)
{
TCHAR* fullPath = _tfullpath (NULL, strDirectory, 0);
if (fullPath == NULL)
return (false);
TCHAR szCurrDir [_MAX_PATH];
_tgetcwd (szCurrDir, _MAX_PATH - 1);
long nStatus = _tchdir (fullPath);
_tchdir (szCurrDir);
free (fullPath);
if (nStatus == 0)
return (true);
return (false);
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|