|
|
Filenames are just text. Use GetClipboardData(CF_TEXT) .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All
When i am useing this code then i am geting text only which is copy .
HANDLE clip;
if (::OpenClipboard(NULL))
{
clip = GetClipboardData(CF_TEXT);
CloseClipboard();
}
CString text;
text = (char*)clip;
AfxMessageBox(text);
Now i want to know File Name Copy.Can any one tell me what i use.
|
|
|
|
|
MsmVc wrote: Now i want to know File Name Copy.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
I need to develop a miltiple-language-application, which must uae english, chinese, japanese and more.
but I only used english in VC before.
what do I need to do for the miltiple-language-application?
1. use different version of VC for respective language?
2. use different OS?
3. both above?
4. something more?
could you give me any comments?
thanks
|
|
|
|
|
|
|
Creating 2 regions and making intersect them.
By using SetWindowPos bringing up the back window to top(HWN_TOP).
But it is showing only topper window(not specified window)
|
|
|
|
|
What do regions have to do with this?
What does the SetWindowPos call look like?
Are we supposed to guess?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Are we supposed to guess?
Yes, you MVP are supposed to have the CPMRU 's battery pack fully charged.
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 always forget to charge
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I need some help to convert an image to byte array and byte array to image. Can any one help? 
|
|
|
|
|
You can start with GetDIBits GDI API function.
GetDIBits
The GetDIBits function retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.
int GetDIBits(
HDC hdc, // handle to DC
HBITMAP hbmp, // handle to bitmap
UINT uStartScan, // first scan line to set
UINT cScanLines, // number of scan lines to copy
LPVOID lpvBits, // array for bitmap bits
LPBITMAPINFO lpbi, // bitmap data buffer
UINT uUsage // RGB or palette index
);
|
|
|
|
|
How to get the blob data from this function? where is the blob data found in it??
|
|
|
|
|
Jose's reply is great for HBITMAPs.
Just using the word "image" is extremely vague. It's a lot easier for
us to help you if you're a bit more specific. What kind of image?
What format is the image? etc...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Actually i am writing code to diaply image read by an imagescanner device.
In this i need to support all formats of images. So, i need to display an image which is in byte array format. How to do that?
|
|
|
|
|
hari_honey wrote: i need to support all formats of images
All? That's pretty ambitious.
Many image formats are published. You'll need to study the format specifications
and read/write the byte streams accordingly.
For BMP, GIF, JPEG, Exif, PNG, and TIFF, GDI+[^] can help.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You don't need to: images are just a byte arrays.
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]
|
|
|
|
|
Hi All,
I am trying to automate the excel into simpe MFC application. I am using excel 2007. But code is not working. Can one see any problem with this code?
#include "stdafx.h"
#include "afxdisp.h"
#include "excel.h"
#include "AutoExcel.h"
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
_Application app;
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
cerr <<_T("Fatal Error: MFC initialization failed")<<endl;
nRetCode = 1;
}
if(!AfxOleInit())
{
AfxMessageBox("Could not initialize COM dll");
return FALSE;
}
else
{
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't start Excel.");
}
else
{
app.SetVisible(TRUE);
AfxMessageBox ("Excel is Running!");
}
}
return nRetCode;
}
|
|
|
|
|
SRKSHOME wrote: But code is not working.
Which means what exactly ?
|
|
|
|
|
Excel is not starting.Excel object is not realy creating.I am always getting the message like "Couldn't Start excel". It is failing in below code.
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Couldn't start Excel.");
}
|
|
|
|
|
_Application::CreateDispatch() returns a BOOL .
The _Application class derives from COleDispatchDriver .
You should provide a pointer to a COleException in the call to CreateDispatch() to get hold of the error.
Read how here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I do not see com initialization code in your program.
call CoInitialize/CoInitializeEx to initialize COM.
I hope it helps.
Check rogers reply..
Regards,
Sandip.
modified on Friday, October 17, 2008 7:50 AM
|
|
|
|
|
The call chain of AfxOleInit() eventually calls ::CoInitializeEx() and sets up an STA.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|