|
Hello dear friends,
I am developing a toolbar.
I've included the menu in the project's resource file.
I want to dispaly this menu when a button of toolbar clicked.
I've made the button with BTNS_WHOLEDROPDOWN style.
I want to display the floating menu using TrackPopupMenu.
the problem is when I load the menu using LoadMenu this function fails and
GetLastError() returns "The specified resource type cannot be found in
the image file" I don't understand the problem.Please help me out.
Thanks in Advanced.
ritz1234
|
|
|
|
|
have you used MAKEINTRESOURCE() to specify the Integer resource ID.
post the code snippet.
modified on Saturday, May 10, 2008 3:29 AM
|
|
|
|
|
Hi all,
I have made a apllication using vc2005, my problem is its running on some machine and on some machine its giving error
the application has failed to start because its side by side configuration is incorrect. Please see the application event log for more details....
I have serched on google they have told to install the Microsoft Visual C++ 2005 Redistributable Package.
i have done it but still the problem persists
Can anybody help me in this...
Thanks in advance
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
which binary you are trying to run, is that release configured or debug configured.
Redistributable is available only for release build.
|
|
|
|
|
I have tried it using both realease and debug mode but the problem still persists...
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
In normal DLL, to export a function we place extern "c" __declspec(dllexport) before the funtion prototype.
Can any one tell me what this extern "c" indicates and what happens if we don't use extern "c" before __declspec while exporting and importing the function.
Thanks in advance.
|
|
|
|
|
|
extern "C" makes the function exported using C-like mangling scheme (instead of C++ one), this is, for instance, the standard for Win32 API .
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
|
|
|
|
|
extern <string literal> specifies the external linkage that its name is visible outside the file in which it is defined, Microsoft C++ supports the strings "C" and "C++" in the string-literal field to specify the linkage convention of other languages, you can link to the function, if the linkage conventions are same.
|
|
|
|
|
I use this code to create a value in Registry:
CString strValue;
DWORD dwBytes ;
LPBYTE lpData ;
strValue=_T("1doandaithietladaidaihoncaidoanhoinaylunnecoithumaychaydcko?");
dwBytes = strValue.GetLength()+1;
lpData = (LPBYTE) strValue.GetBuffer(dwBytes);
::RegSetValueEx(m_hSectionKey, _T("Test"), NULL, REG_SZ, lpData, dwBytes);
But the value data in Registry is just : "1doandaithietladaidaihoncaidoa"
Someone plz help me to explain & give me a solution
|
|
|
|
|
Your building a UNICODE application hence each character is 2 bytes wide.
The correct value for dwBytes is:
dwBytes = (strValue.getLength()+1)*sizeof(TCHAR);
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
|
|
|
|
|
And see this[^] article for more help.
|
|
|
|
|
Oh It worked, thanks so much
|
|
|
|
|
Why are you calling GetBuffer() ? Unless you are also modifying strValue , it is unnecessary and potentially dangerous.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Good point.
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
|
|
|
|
|
Hi,
I and writing MFC application for Mobile 6 on HP iPAQ.
When I tap on the screen (with stylus) and continue to hold it (TAP and HOLD), a circle of "small solid circles" appear. I do not want to implement any context menu; instead I want this circle of "small solid circles" to disappear.
I am thinking that if I can somehow catch an even for "TAP and HOLD" I can avoid this.
If you could let me know how to do this I would greatly appreciate it.
Thanks!
-A
|
|
|
|
|
|
I am tring to write a class that defines location based on latitude & longitude. I have searched high and low with no such luck. Can anyone help?
|
|
|
|
|
|
Here is what I have so far. I'm now tring to figure out how to get both Latitude & Longitude to appear. Not just one or the other. I also need to get North/South East/West into the code. Any ideas?
<br />
<br />
class location<br />
{<br />
private:<br />
int degrees;<br />
int minutes;<br />
int seconds;<br />
<br />
public:<br />
location(int d, int m, int s);<br />
~location();<br />
<br />
void setdegrees(int d);<br />
void setminutes(int m);<br />
void setseconds(int s);<br />
<br />
<br />
int getdegrees();<br />
int getminutes();<br />
int getseconds();<br />
void properties();<br />
};<br />
<br />
<br />
#include<iostream><br />
#include"location.h"<br />
<br />
using namespace std;<br />
<br />
location::location(int d, int m, int s)<br />
{<br />
degrees = d;<br />
minutes = m;<br />
seconds = s;<br />
}<br />
<br />
location::~location()<br />
{<br />
<br />
}<br />
<br />
void location::setdegrees(int d)<br />
{<br />
degrees = d;<br />
}<br />
<br />
void location::setminutes(int m)<br />
{<br />
minutes = m;<br />
}<br />
<br />
void location::setseconds(int s)<br />
{<br />
seconds = s;<br />
}<br />
<br />
int location::getdegrees()<br />
{<br />
return degrees;<br />
}<br />
<br />
int location::getminutes()<br />
{<br />
return minutes;<br />
}<br />
<br />
int location::getseconds()<br />
{<br />
return seconds;<br />
}<br />
<br />
void location::properties()<br />
{<br />
cout<<" Degrees"<<getdegrees() <<endl;<br />
cout<<" Minutes"<<getminutes() <<endl;<br />
cout<<" Seconds"<<getseconds() <<endl;<br />
}<br />
<br />
<br />
#include"location.h"<br />
#include<iostream><br />
<br />
int main(int argc, char *argv[])<br />
{<br />
location city(51, 30, 0);<br />
city.properties();<br />
<br />
system("PAUSE");<br />
return 0;<br />
}<br />
|
|
|
|
|
so why wouldnt you have something like :-
//location.h
class location
{
private:
(some appropriate data type) longitude;
(some appropriate data type) latitude;
its not impossible to continue with what you've got though if thats what you really want - then you could do
//location.h
class location
{
private:
int lat_degrees;
int lat_minutes;
int lat_seconds;
int long_degrees;
int long_minutes;
int long_seconds;
but that means now you've got 3 set/get routines for 'lat' d/m/s and 3 for 'long'
.. Im sure somewhere in those links I gave you was a better way of storing lat/longs than d/m/s, but I didnt read them fully, they were for ideas ....
'g'
|
|
|
|
|
i have a problem creating resourcebundle....i made two programs
1.resourcecreator.exe( it creates the resource using calc.exe into extractor.exe)
2.extractor.exe ( it is the program on which resource is created....and same program when run uses itself to extract the resource calc.exe)...
on creating resource by using resourcecreator.exe when i try to run updated extractor.exe it gives error..."extractor.exe is not a valid win32 application"...
resourcecreator.cpp
#include"windows.h"
#include"conio.h"
#include"stdio.h"
int main()
{
HANDLE hFile;
HANDLE hResource;
DWORD dwFileSize,
dwBytesRead;
LPBYTE lpBuffer;
hFile = CreateFile("calc.exe", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hFile == NULL )
{
printf("%s","file not opened" );
}
else
{
printf( "%s","file opened" );
}
if (INVALID_HANDLE_VALUE != hFile)
{
dwFileSize = GetFileSize(hFile, NULL);
lpBuffer = new BYTE[dwFileSize];
if (ReadFile(hFile, lpBuffer, dwFileSize, &dwBytesRead, NULL) != FALSE)
{
hResource = BeginUpdateResource("extractor.exe", FALSE);
if (NULL != hResource)
{
if (UpdateResource(hResource,
RT_RCDATA,
MAKEINTRESOURCE(104),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPVOID) lpBuffer,
dwFileSize) != FALSE)
{
EndUpdateResource(hResource, FALSE);
printf("%s","\nresource updated" );
}
}
}
delete [] lpBuffer;
CloseHandle(hFile);
}
getch();
return 0;
}
-----------------------------------------------
extractor.cpp
#include"windows.h"
int main()
{
HMODULE hLibrary;
HRSRC hResource;
HGLOBAL hResourceLoaded;
LPBYTE lpBuffer;
hLibrary = LoadLibrary("extractor.exe");
if (NULL != hLibrary)
{
hResource = FindResource(hLibrary, MAKEINTRESOURCE(104), RT_RCDATA);
if (NULL != hResource)
{
hResourceLoaded = LoadResource(hLibrary, hResource);
if (NULL != hResourceLoaded)
{
lpBuffer = (LPBYTE) LockResource(hResourceLoaded);
if (NULL != lpBuffer)
{
DWORD dwFileSize,dwBytesWritten;
HANDLE hFile;
dwFileSize = SizeofResource(hLibrary, hResource);
hFile = CreateFile("newcreation.exe", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (INVALID_HANDLE_VALUE != hFile)
{
WriteFile(hFile, lpBuffer, dwFileSize, &dwBytesWritten, NULL);
CloseHandle(hFile);
}
}
}
}
FreeLibrary(hLibrary);
}
return 0;
}
can you guide me a little bit...it would be really nice..
thanx....mail me at ashutosh.dhiman@gmail.com
there are 10 type of people in the world...
01 who understand binary.
10 who don't...
|
|
|
|
|
hey every one...i have a prob.....i am making a program which will generate an exe...i want when i run my program....it should make a text file which is not a problem and one exe file...which is some other program that i built......not the same as the program from which im making this exe....what should i do for that??? i just had a random idea in my mind...i though every file is a file...why not try like text file..so i changed the extension of the exe(that i want to generate by running other one i.e. exe that i want to produce) in txt...then copied that into fputs("all the converted file contents here", outfile)....then tried to run...changed all escape seqence and all( like " changed to \" )...but didn't work as i expected....i knw its a very lame idea.... ...can someone tell me how to do this....any idea guys??/
there are 10 type of people in the world...
01 who understand binary.
10 who don't...
|
|
|
|
|
I don't understand you binary.
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
|
|
|
|
|