|
dont worry about this one guys..
i have replaced ClientToScreen with the function GetCursorPos and all is rosey!!
|
|
|
|
|
Hi all,
I want to know how much memory is allocated by SafeArrayCreate()
Is there any std. functons?
Thanks,
Gan
|
|
|
|
|
I guess you have not checked SAFEARRAY documentation.
|
|
|
|
|
Hi guys,
We have a string table in a lib file(a.lib)
We are linking that a.lib file to a comdll (b.dll) and try to get the strings from a.lib 's string table. I got the string no probs.
When I changed the string table in the lib (a.lib), like altering the strings, adding new string items, I can see the changes in the string table
But I can't get the changed strings or newly added strings.With changed strings, Changes are not reflected ; With newly added string the fn. returned false and I got the error 1814.
And I can see the updated strings, when I open the a.lib in text mode.(vc++6.0 editor)
(when I updated the string table using resource editor I got error RC2104. Then I updated that .rc file by opened it in text mode and updated the string table. By this only I was able to update the string table)
Anybody knows the reason?
thanks,
Gan
|
|
|
|
|
Hi GANsJob,
I think your b.dll is still loaded. Check this.
Greetings
Ralph
|
|
|
|
|
hi, i have created a program that uses several different header files and to make it easy for all header files to access stuff i had all my cpp files just reference 1 file that includes all my header files. all of the files compile fine except 1 which complains about a undeclared variable that is part of one of my classes but what makes no sense is that that source file sees my class with that variable in it just fine and intellisense shows the class variable that is supposedly undeclared. thanks in advance for any advice anyone can give me.
|
|
|
|
|
Sounds like we need to see the code.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
here is the function that has the problem:
typedef void (*MYPROC)(LPTSTR);<br />
MYPROC ProcAdd;<br />
BOOL fRunTimeLinkSuccess;<br />
Load *a;<br />
Loader *b;<br />
<br />
a->Hide(load_window);<br />
b->Hide(loader_window);<br />
<br />
hinstLib = LoadLibrary(program);<br />
if(hinstLib != NULL)<br />
{<br />
ProcAdd = (MYPROC)GetProcAddress(hinstLib, "?prog_start@@YAHXZ");<br />
if(fRunTimeLinkSuccess = (ProcAdd != NULL))<br />
{<br />
(ProcAdd)("?prog_start@@YAHXZ");<br />
}<br />
else{<br />
MessageBox(m_hWnd, "Program Failed to Load", "Fail", MB_ICONSTOP);<br />
<br />
EndDialog(m_hWnd, IDOK);<br />
}<br />
}<br />
else{<br />
MessageBox(m_hWnd, "Loader Failed to open program", "Fail", MB_ICONSTOP);<br />
reportError();<br />
}<br />
fFreeResult = FreeLibrary(hinstLib);<br />
<br />
b->Show(loader_window);<br />
a->Show(load_window);
not exactly the best way to load a dll file but it works for what i was doing right now to test stuff with. loader_window is the one that can not be seen, it is a hwnd variable to one of the windows in my program.
and here is the code where i have everything being included:
#ifndef MAIN_H<br />
#define MAIN_H<br />
<br />
#include <windows.h><br />
#include <sstream><br />
#include "..\common\win32.h"<br />
#include "resource.h"<br />
#include "loader.h"<br />
#include "load.h"<br />
#include "help.h"<br />
#include "version.h"<br />
<br />
#endif
|
|
|
|
|
You probably need to understand the difference between declared and defined.
declaring a variable tells the compiler that such a variable exists somewhere [else].
defining a variable causes the variable to exist.
This is somewhat of a simplification for the sake of a quick answer
You may be seeing an undefined variable error for a variable that is declared in your header file; that is, you told the compiler that the variable exists but it doesn't exist. Compilers (and linkers) don't like being lied to.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
where this "loader_window" is declared?
It should be declared as a global variable, if you want to use it in the code you posted.
Check the variable's scope.
|
|
|
|
|
well i had it as global but because of how my code is set up, i can not really compile the program very easily without having to force the program to be compiled because it will get included more than once and the 15+ warnings it gives got annoying to look at and unless i do force it to compile than it will register as errors instead.
|
|
|
|
|
just paste the code of the headers in which you have declared th variables.
|
|
|
|
|
I've created a class which loads a dialogue box, from a resource created in Visual Studio 2003.
I need to run some intialization code, so set labels corrected basied upon some paramters passed in. I've tried catching WM_CREATE in the DlgProc method, however the WM_CREATE message is never passed into the methods.
How would I be able to run some code when the dialog starts up?
|
|
|
|
|
|
OnInitDialog() [^] is the appropriate place to put dialog initialization code.
/ravi
|
|
|
|
|
It doesn't sound as if he's using MFC. He needs to handle WM_INITDIALOG, which is (roughly) the dialog equivalent of WM_CREATE.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
I am looking for software to tune my accoustic piano. I have found free software that does that for guitars but, obviously, doesn't go low enough or high enough in frequencies to do my piano. The same holds true for my son's electronic guitar tuner.
If anyone knows of "open source" software (preferably Visual C++ / MFC) that for guitars that I could mofify to extend wide enough to do pianos would be greatly appreciated. If I am able to convert it into a useful application, I will gladly post it here.
Thank you in advance
Pierre
|
|
|
|
|
have you looked at basic MIDI sequencers ?
ex: Jazz++
|
|
|
|
|
I don't know if I understand your reply Chris.
What would a MIDI sequencer do for me and my non-electronic accoustic piano?
I need something similar to an electronic guitar tuner with a built-in microphone. I tried my son's and it worked fine but only in the middle range of the piano where the guitar falls in.
As I mentioned previously, I recently found some free software on the internet that you can plug a guitar (or microphone) into the sound card of your computer and tune that way. That software had two problems.
1) It was designed for guitars so it had the same issue as my son's electonic tuner.
2) It was the executable only so I couldn't modify it to extend its range over the entire 88 keys of the piano.
Regards
Pierre
|
|
|
|
|
pblais wrote: s I mentioned previously, I recently found some free software on the internet that you can plug a guitar (or microphone) into the sound card of your computer and tune that way.
sorry, i didn't see where you mentioned plugging anything into the sound card... i thought you were doing it by ear.
|
|
|
|
|
Google ( with "open source guitar tuner" ) returned one hit on sourceforge.
I assume that for a software solution to work you will need a good microphone and a good soundcard to convert to a good useable frequence.
|
|
|
|
|
If you have a good enough ear to tune a piano then all you need to do is tune an octave somewhere in the middle (and a guitar tuner could help with that) and then tune the other octaves from that. If your ear isn't good enough to do that then your results would be pretty poor anyway, even if you can get the frequencies correct. There's a lot more to piano tuning than just getting a string to sound the right frequency.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Is it possible to Pass a 2dimension array to a function without specifying number of elements..
Thanks in advance
|
|
|
|
|
subburamKR wrote: Is it possible to Pass a 2dimension array to a function without specifying number of elements
Of course: you can pass the address of that array. The question is what can do the function with an array of unknown sizes?
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.
|
|
|
|
|
if it is a C matrix, then no, the function has no other way to know the number of elements but by getting it as a parameter. wonder what can happen if the function read/writes outside the actual bounds of the array ?
but you can construct a matrix class, or a std::vector<std::vector<type>>
|
|
|
|