|
I just got this error yesterday with VS 2005. I thought it had been solved with SP1, but it hadn't. My solution was to access the class view from the header. Don't know why it worked.
|
|
|
|
|
I using Window CE API WriteFile() to write some barcode data to a file. Data is scanned and written to file ok. Problem is everything is on one line. How can I get the data in the file to be
line based. In other words, everytime I write to the file it writes a new line.
Thanks
|
|
|
|
|
Hi egerving,
The escape sequences for newline [^]in C/C++ is '\n'
Best Wishes,
-David Delaune
|
|
|
|
|
If Randor's suggestion doesn't work, you should try writing "\r\n".
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Using MFC & VC6
I am terribly confused about how to move CWnd objects around. With screen coords, client coords, dialog units, screen units, AaaRGh.
I have dialog app with button controls. From the OnSelect function of the buttons I am calling another popup dialog of my own making. I want to position the popup dialog so it obscure certain areas of the main dialog.
I am trying to use CWnd::MoveWindow() to move my popup dialog in the OnInitDialog() function to a position relative to the top left postion of the main dialog.
Which methods should I be using to get the main dialogs position to calculate coords for the MoveWindow() function in the correct units. A small example would be useful. Has anyone made a small Class to handle all this confussing translation between all the possible units and coordinte references ?
|
|
|
|
|
For that you want to use this route:
- Get the area of the main dialog that you want to obscure - this is most likely to be in client co-ordinates
- Convert to screen co-ordinates using CWnd::ClientToScreen[^]
- Now ensure that the child dialog covers that (screen co-ordinate) area. If you use MoveWindow, the screen co-ordinates are what you want to position the dialog
HTH!!!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Neil Urquhart wrote: I am terribly confused about how to move CWnd objects around. With screen coords, client coords, dialog units, screen units, AaaRGh.
I totally agree on that. Really understand your frustration..
Rozis
|
|
|
|
|
Hi i am new to vc++6.0 and i want to get menu item text which clicked by user.i tried with WH_GETMESSAGE hook and able to get menu item text for notepad,wordpad...but when i tried with vs2005 no WM_COMMAND is generating when i visit the menu item or clicked?
please tell me the way how we can get the menu item text for these application...is it not possible with hooking? from past one week i am searching for this...
Thanks in advance..
|
|
|
|
|
pashamsridhar wrote: Hi i am new to vc++6.0 and i want to get menu item text which clicked by user.
Which menu? One in an application you've written?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I already mentioned in my post i tried with vs2005..i want to get menu text when the user clicks any menu item in vs2005.
i am working with vc++6.0...please help me how to do this?
|
|
|
|
|
I suspect VS has non-standard menus (like Office….). I would use Spy++ (comes with Visual Studio) to see what messages ARE generated when you select a menu item.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
use this function for get the menu item text,
GetMenuString();
Copies the label of the specified menu item to the specified buffer.
int GetMenuString(
UINT nIDItem,
LPTSTR lpString,
int nMaxCount,
UINT nFlags
) const;
int GetMenuString(
UINT nIDItem,
CString& rString,
UINT nFlags
) const;
Regards,
Srinivas
|
|
|
|
|
I have installed mysql on my PC and created a database (sysops).
But I don't know how to connect and open the database.
I know how to use remote mysql, host (www...), user-name, password, database neme..,
What are connect info for local mysql?
Please help if you have experiences.
|
|
|
|
|
host is localhost or 127.0.0.1, rest all you should know.
-Saurabh
|
|
|
|
|
Rest all you should know.
---------------------
I don't know.
Do you mean I need to create a user and password for the created mysql database?
|
|
|
|
|
Well you said you know how to connect to remote SQL so I assumed that you know about all parameters except host name.
No you dont necessarily have to create a separate user and password for every database. You can create a user in MySql and then assign it permissions to access a database. You can download MySql Gui Tools[^] to easily create users and databases.
-Saurabh
|
|
|
|
|
Hi All
how to create new bitmap ?
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
By selecting 'New' from the file menu.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Please provide a bit more information about what you mean because otherwise we won't be able to help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
i have one image file which contains 5 buildings ..i want to cut and save only the 5th building ,other four buildings are not shown in the image.
but when we are save the image 5th building not shown other four buildings are shown in the image...
this is my code snippet::
<code>
HDC pDC=::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
CImage _image;
_image.Load(_T("//read.tif"));
int width=_image.GetWidth();
int height=_image.GetHeight();
HGDIOBJ TmpObj2 = SelectObject(TmpDC,(HGDIOBJ)(HBITMAP)_image);
Rectangle(TmpDC, 0,0, width/2, height/2 );
SelectObject(TmpDC,TmpObj2);
_image.Save( _T("D:\\newy.jpg"), Gdiplus::ImageFormatBMP);
::ReleaseDC(NULL,pDC);
</code>
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
So let me get this right, you open a tif file, draw a rectangle on it that is suposed to overlap some part of the picture and then you save the image to another file, right? (Btw why do you specify Gdiplus::ImageFormatBMP for the Save call while you are trying to save a jpg?) Your problem is that not the part of the image is overlapped you want? Why don't you move the rectangle then?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
how to create one rectangle piece of image from existing image??
this is doubt
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Ah well, create a new bitmap in memory with the required size, blit from the source image to the target image the part you want to cut out and then save this new bitmap.
So something like this:
HDC pDC=::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
CImage _image;
_image.Load(_T("//read.tif"));
int width=_image.GetWidth();
int height=_image.GetHeight();
HGDIOBJ TmpObj2 = SelectObject(TmpDC,(HGDIOBJ)(HBITMAP)_image);
int newWidth = width/2;
int newHeight = height/2;
HDC NewDC = CreateCompatibleDC(TmpDC);
HBITMAP NewBitmap = CreateCompatibleBitmap(TmpDC, newWidth, newHeight);
HGDIOBJ NewTmpObj = SelectObject(NewDC, NewBitmap);
BitBlt(NewDC, 0, 0, newWidth, newHeight, TmpDC, 0, 0, SRCCOPY);
SelectObject(NewDC, NewTmpObj);
DeleteDC(NewDC);
SelectObject(TmpDC,TmpObj2);
::ReleaseDC(NULL,pDC);
CImage newImage;
newImage.Attach(NewBitmap);
newImage.Save( _T("D:\\newy.jpg"), Gdiplus::ImageFormatJPEG);
DeleteObject(NewBitmap);
I am not saying this code works or if it compiles at all, but it can be a starting point for you to get the idea, good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi,
I saw (from your posts) that you are using CImage class. So if you need to copy the loaded image to the new one you can use the BitBlt() method of CImage .
Here is the code fragment to create a copy of given original image:
CImage imageOriginal;
imageOriginal.Load(_T("Here is the path to your original image"));
CImage imageNew;
imageNew.Create(imageOriginal.GetWidth(), imageOriginal.GetHeight(), imageOriginal.GetBPP());
imageOriginal.BitBlt(imageNew.GetDC(), CPoint(0,0));
imageNew.ReleaseDC();
....
The above example makes an exact copy of the loaded image.
If you need to copy the specific part of the loaded image, for instance a rectangular part, then you can use the BitBlt() method again, but this time the code could be something like this:
CImage imageOriginal;
imageOriginal.Load(_T("Here is the path to your original image"));
CRect rectCopy(0, 0, imageOriginal.GetWidth() / 2, imageOriginal.GetHeight() / 2);
CImage imageNew;
imageNew.Create(rectCopy.Width(), rectCopy.Height(), imageOriginal.GetBPP());
imageOriginal.BitBlt(imageNew.GetDC(), rectCopy, rectCopy.TopLeft());
imageNew.ReleaseDC();
I hope this helps!
Nuri Ismail
|
|
|
|