|
kapardhi wrote: I donot know whether the image is an .bmp or .jpg or .jp2 image.
Maybe you don't know the image format at all. How are we supposed to know it, instead?
You may try to interpretate your image data as RGB (or greyscale) components.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think your answer was perfect because you got 1 if it was wrong you got 5.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thank you for balancing, pal.
He continues posting again and again, without recognizing what is the actual hurdle: he know nothing about the content of 'the byte array'.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sorry for repling lately!
Thankyou!
I will first try to gain knowledge in Images and their formats etc. all the stuff then i will try to code my requirement then i may iask my doubts to you.
Thanks!
|
|
|
|
|
For convert formats you can use of CImage class I dont think you can use of it for jp2 but you can find good article on the codeproject for helpful info about image formats search for CXImage article (of course you dont need to convert bmp to bmp ).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
I had to modify the .odl file for adding one more method. Any idea why its not coming to the newmethod while debugging..I have checked the MIDl and the tlb is created file with res.
test.odl
dispinterface _programctrl<br />
{<br />
[id(30)] boolean newmethod(BSTR var1,BSTR var2, BSTR var3, BSTR var4, BSTR var5);<br />
}<br />
The method is coming fine when I have tested on the activextest container but the problem is when I invoke the method it is not coming to the program while debugging..I have opted 30 as id random number.id[30]
I have called the method like this
testpgm.cpp
DISP_FUNCTION(testcontrl, "newmethod", newmethod, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR)<br />
<br />
BOOL testpgm::newmethod(LPCTSTR var1,LPCTSTR var2,LPCTSTR var3,LPCTSTR var4,LPCTSTR var5) <br />
{<br />
<br />
return TRUE;<br />
}<br />
<br />
testpgm.h
dispidnewmethod = 30L
Thanks,
Rahul..
SoftwareDeveloper(.NET)
modified on Sunday, April 26, 2009 9:11 AM
|
|
|
|
|
I have resolved the issue finally with the following changes to the code given..
What I found was the DISP_FUNCTION usage couldn't exactly trace the id of the method..Instead when I used DISP_FUNCTION_ID, it started working..I have noticed that the DISP_FUNCTION_ID call having a parameter option to pass dispid of the method as well..Not sure why the DISP_FUNCTION couldn't work but anyhow my issue got resolved with DISP_FUNCTION_ID..
Similarly in the .h file I have changed 30L to just 30. Rest all are same..
<br />
DISP_FUNCTION_ID(testcontrl, "newmethod",dispidnewmethod, newmethod, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR)<br />
<br />
public:<br />
enum{ <br />
dispidnewmethod = 30, ..
Thanks,
SoftwareDeveloper(.NET)
|
|
|
|
|
MFC, STUDIO 2008, MDI
There are into project some global variable created same method
Last ‘m_gsADDRESSHOM’ can’t to create.
extern CString m_gsADDRESSHOM; // set into file stdafx.h
// modeldlg2.cpp : implementation file
#include "stdafx.h"
#include "modeldlg2.h"
CString m_gsADDRESSHOM;
// CMainDlg2 dialog
Using global variable
pEdit_ADDRESS->SetWindowTextW(dlg7.m_gsADDRESSHOM); // error C2039: 'm_gsADDRESSHOM' : is not a member of 'CMainDlg2'
|
|
|
|
|
durban2 wrote: Using global variable
durban2 wrote: dlg7.m_gsADDRESSHOM
It's a global variable - that means it's not a member of dlg7, so don't treat it as if it were.
Do you think you maybe need to read an introductory C++ text[^], to learn these basics?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
durban2 wrote: pEdit_ADDRESS->SetWindowTextW(dlg7.m_gsADDRESSHOM);
try using like this :-
pEdit_ADDRESS->SetWindowTextW(m_gsADDRESSHOM);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
MFC, STUDIO 2008, MDI
Why ignore ( skip ) value from OnInitDialog()
There are modal and modeless windows:
// modeldlg2.h
class CMainDlg2 : public CDialog // modal window
{
public:
virtual BOOL OnInitDialog();
CString m_sPP_modal7;
};
// adderdlg2.h
class CAdderDialog2 : public Cdialog // modeless window
{
public:
virtual BOOL OnInitDialog();
};
// modeldlg2.cpp : implementation file
CMainDlg2::CMainDlg2(CWnd* pParent /*=NULL*/) // standard constructor
: CDialog(CMainDlg2::IDD, pParent)
m_sPP_modal7 = "Paris";
}
BOOL CMainDlg2::OnInitDialog()
{
CDialog::OnInitDialog();
m_sPP_modal7 = "New-York";
return TRUE; // return TRUE unless you set the focus to a control
}
// adderdlg2.cpp : implementation file MODELESS window
BOOL CAdderDialog2::OnInitDialog()
{
CDialog::OnInitDialog();
CMainDlg2 dlg7;
MessageBox(L"dlg7.m_sPP_modal7 = \n" + dlg7.m_sPP_modal7);
Why have been chose value from constructor but not from
the method OnInitDialog() modal window?
}
Result: Paris
Why not New-York ?
How to receive New-York ?
|
|
|
|
|
durban2 wrote: Why not New-York ?
Because the dlg7 member hasn't been created as a window yet, so hasn't received WM_INITDIALOG yet. You may have noticed that you haven't seen that dialog at all?
durban2 wrote: How to receive New-York ?
You need to get a WM_INITDIALOG sent to your dialog. Which means showing it. Which menas that as it's a modal dialog, you need to call dlg7.DoModal() before the MessageBox call.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
durban2 wrote: Why have been chose value from constructor but not from
the method OnInitDialog() modal window?
because, OnInitDialog for dlg7 is not called yet, it only call once Dialog is created!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
MFC, STUDIO 2008, MDI
CButton m_button1;
CString font(L"Courier New");
m_button1.SetFont(font,20); // error C2664: 'CWnd::SetFont' : cannot convert parameter 1 from 'const wchar_t [12]' to 'CFont *'
m_button1.SetFont(L"Courier New",20); // error C2664: 'CWnd::SetFont' : cannot convert parameter 1 from 'const wchar_t [12]' to 'CFont *'
2. // How do to set BOLD FONT on button?
m_button1.SetFont(L"Courier New",20,600); // error C2660: 'CWnd::SetFont' : function does not take 3 arguments
Add
#include "afxctl.h"
class CFontHolder; // add into header file my class where is command button
that I want write caption.
|
|
|
|
|
Have you looked at the documentation at all? Stupid question really, 'cause you obviously haven't. Does help, though.
Anyway - that has the definition for CWnd::SetFont , which is this:
void SetFont(
CFont* pFont,
BOOL bRedraw = TRUE
);
No strings mentioned there?
So, to change the font, you need to create a CFont . To do that, add a CFont data member to the class this code is in (the view?). Initialise the font with CFont::CreateFont and call m_button1.SetFont passing the address of the CFont data member.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
First of all you can see parameters of functions on your code you need to make this font(Courier New) for it you can use of CreateFont/CFont class and then you can use of it of the SetFont much as you are new to VC++ you can read error message(Can not convert to CFont*) so you can think its parameter is CFont not CString.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
when i try to build ALMTree.hand ALMTree.cpp file in mfc application everything is all right at first.
Then i would like to employ <iostream> in .cpp file to prompt some hints with the help of "cout"
so in the .cpp file, #include <iostrem> is used.
But lots of errors occurred:
:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'
d:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function
d:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters
d:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE'
d:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function
d:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
is there anyone who can offer help?
Attached is the .cpp file briefly:
// ALMTree.cpp: implementation of the CALMTree class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "TALM_AED.h"
#include "ALMTree.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//#include <iostream>
//using namespace std;
CALMTree::CALMTree()
{
****************************************
// cout<<"The tree is constructed";
****************************************
}
CALMTree::~CALMTree()
{
Destroy();
}
CALMTree::CALMTree(const CALMTree& listSrc)
{
int i, size;
size = listSrc.GetTreeSize();
if(size<=0)
return;
}
const CALMTree& CALMTree:: operator=(const CALMTree& listSrc)
{}
|
|
|
|
|
First - when you paste C++ code, please tick the checkbox labelled "Auto-encode HTML when pasting?" That way, your #includes don't get obfuscated.
Secondly - I think your problem will be solved by putting the #include <iostream> before the #define new DEBUG_NEW - STL doesn't get on with MFC's debugging memory allocator, IIRC.
linux_xjtu wrote: Then i would like to employ in .cpp file to prompt some hints with the help of "cout"
so in the .cpp file, #include is used.
I suspect this is the big, indirect problem - do you have a console in your MFC app? Without a console, std::cout won't do you much good.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I need to be able to display a 3d object on desktop with transparent background so it seems like it's drawn directly to desktop. I managed to do that with layerd window and openGL. Here is the code making my main window layered:
///////////////LAYERD WINDOW/////////////////////////
SetWindowLong (hWnd , GWL_EXSTYLE ,
GetWindowLong (hWnd , GWL_EXSTYLE ) | WS_EX_LAYERED ) ;
typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
PSLWA pSetLayeredWindowAttributes;
HMODULE hDLL = LoadLibrary ("user32");
pSetLayeredWindowAttributes =
(PSLWA) GetProcAddress(hDLL,"SetLayeredWindowAttributes");
if (pSetLayeredWindowAttributes != NULL) {
pSetLayeredWindowAttributes (hWnd,
RGB(0,0,0), 255, LWA_COLORKEY|LWA_ALPHA);
}
/////////////////////////END LAYERED WINDOW
I need to be able to have this functionality with DirectX programming. This method didn't work for me. Is this the correct way to do it or maybe some other technique is more proper. I'm thinking maybe using windows regions instead of transparency or something else I'm not aware of.
Any help or advice would be greatly appreciated.
|
|
|
|
|
Hi,
I have one scenario in code that finds all files from the given local/unc path with wildchar. The code sample is given. The enumerator could iterate through the number of files in that path and return the exact path of each file and which will be added to an array for later use..
The above part is working fine..but my requirement is to find the files in similar way with the url path. For eg; the path will be http://server/test/*.bmp and it need to get the url of all file existing on that path like, http://server/test/a.bmp, b.bmp, etc..
Is there any way similar to the code given to do this for url path..I have tried the way OpenUrl() and CinternetSession but it didn't work..Would really appreciate for showing the right way..
CFileFind fileFinder;<br />
char oldDirectory[512]; <br />
GetCurrentDirectory(512,oldDirectory);<br />
BOOL flag= fileFinder.FindFile(pathDirectory+strWildcard);<br />
while(flag )<br />
{<br />
flag = fileFinder.FindNextFile();<br />
lstArray.Add(fileFinder.GetFilePath());<br />
<br />
}<br />
SetCurrentDirectory(oldDirectory);<br />
Thanks in Advance..
SoftwareDeveloper(.NET)
|
|
|
|
|
HTTP doesn't have (as standard) the concepts required to support file finding. Instead, you probably need the server to return a file list when you GET http://server/test/ (many HTTP servers can give directory listings when you access a directory). Then you can filter that file list to work out which files you want to retrieve from the server.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart,
Thanks much for the quick suggestion..I agree that the way server sending the list of files would be better and will proceed in that way..
Appreciating..
Thanks,
Rahul..
SoftwareDeveloper(.NET)
|
|
|
|
|
There is no MFC class for searching on HTTP servers because HTTP does not support the direct file manipulation required for searches. Can you use CFtpFileFind() ?
"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
|
|
|
|
|
I think its better try to find elements on the we sites(for example Buttons,Images,Labels,...).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi David, Hamid,
Thanks much for your responses and suggestions..just made logic like the server finds the list of files from the folder and sending the list to the client with a delimeter then the activex use it..
Thanks,
Rahul..
SoftwareDeveloper(.NET)
|
|
|
|